ベルク・カッツェ
7-5
-3-2
5-5-5
-3-2-2
3-3-3-3
-2-2-2
2-2-2-2-2-2
樹形図で数えて7通りになりました。
   4月24日(木) 0:04:40     53929
ベルク・カッツェ
三番目打ちミスです。
5-5-2
   4月24日(木) 0:05:47     53930
今年から高齢者
2,3,5,7で12を作る組み合わせを書き出しました
   4月24日(木) 0:06:31     53931
今年から高齢者
2,3,5,7で12を作る組み合わせを書き出しました
   4月24日(木) 0:06:45     53932
ゴンとも
十進Basic で

for a=0 to 6
for b=0 to 6
for c=0 to 6
for d=0 to 6
IF 2*a+3*b+5*c+7*d=12 THEN LET s=s+1
next d
next c
next b
next a
PRINT s
END

f9押して 7・・・・・・(答え)

このプログラムは12限定だったんですが他のものもでるものを今から
考えたいんですが眠くて・・・
豊川市   4月24日(木) 0:31:24     53933
ゴンとも
#53933
>このプログラムは12限定だったんですが他のものもでるものを今から
>考えたいんですが眠くて・・・

以下の29までのものは押してすぐなんですが
100ぐらいはどのくらいかかるかは?
やってみればわかるんですが・・・

input n
print time$
for a=0 to n/2
for b=0 to n/3
for c=0 to n/5
for d=0 to n/7
for e=0 to n/11
for f=0 to n/13
for g=0 to n/17
for h=0 to n/19
for i=0 to n/23
for j=0 to n/29
IF 2*a+3*b+5*c+7*d+11*e+13*f+17*g+19*h+23*i+29*j=n THEN LET s=s+1
next j
next i
next h
next g
next f
next e
next d
next c
next b
next a
PRINT s
PRINT TIME$
END
豊川市   4月24日(木) 1:11:11     53934
「数学」小旅行
2、3、5、7を使って、和が12になるようにしました。
   4月24日(木) 3:52:40     53935
「数学」小旅行
p (2..6).map{|x|[2,3,5,7].repeated_combination(x).map{|y|y.sum}}.flatten.count(12)
   4月24日(木) 5:09:20     53936
とまぴょん
chatGPT o3 に聞いたら、正解出してくれました。
   4月24日(木) 6:09:28     53938
手描き図面職人
久しぶりの文章問題なのでchatGPTにプログラムを作成して貰いました。プログラムは、
from sympy import factorint
def factor_sum(n):
  factors=factorint(n)
  return sum([prime*exp for prime,exp in factors.items()])
def find_numbers_with_sum(target_sum,limit=10000):
  result=[]
  for i in range(2,limit):
    if factor_sum(i)==target_sum:
      result.append(i)
  return result
target=12
matching_numbers=find_numbers_with_sum(target)
print(f"出力が{target}になるような数は {len(matching_numbers)} 通りあります。")
print("その数たち:",maching_numbers)
相変わらず凄いプログラムを作成しますね。
   4月24日(木) 16:05:45     53939
いちごみるく
https://oeis.org/A000607
形式的冪級数で考えると
f(n)=Π1/(1-x^P_{i})
※P_{i}はi番目の素数
   4月24日(木) 19:31:38     53940
ゴンとも
#53934

>100ぐらいはどのくらいかかるかは?
>やってみればわかるんですが・・・

やってみました。100までなら30秒程度で・・・

input n
print time$
for a=0 to n/2
IF 2*a>n then goto 250
for b=0 to n/3
IF 2*a+3*b>n then goto 240
for c=0 to n/5
IF 2*a+3*b+5*c>n then goto 230
for d=0 to n/7
IF 2*a+3*b+5*c+7*d>n then goto 220
for e=0 to n/11
IF 2*a+3*b+5*c+7*d+11*e>n then goto 210
for f=0 to n/13
IF 2*a+3*b+5*c+7*d+11*e+13*f>n then goto 200
for g=0 to n/17
IF 2*a+3*b+5*c+7*d+11*e+13*f+17*g>n then goto 190
for h=0 to n/19
IF 2*a+3*b+5*c+7*d+11*e+13*f+17*g+19*h>n then goto 180
for i=0 to n/23
IF 2*a+3*b+5*c+7*d+11*e+13*f+17*g+19*h+23*i>n then goto 170
for j=0 to n/29
IF 2*a+3*b+5*c+7*d+11*e+13*f+17*g+19*h+23*i+29*j>n then goto 160
for k=0 to n/31
IF 2*a+3*b+5*c+7*d+11*e+13*f+17*g+19*h+23*i+29*j+31*k>n then goto 150
for l=0 to n/37
IF 2*a+3*b+5*c+7*d+11*e+13*f+17*g+19*h+23*i+29*j+31*k+37*l>n then goto 140
for m=0 to n/41
IF 2*a+3*b+5*c+7*d+11*e+13*f+17*g+19*h+23*i+29*j+31*k+37*l+41*m>n then goto 130
FOR n1=0 TO n/43
IF 2*a+3*b+5*c+7*d+11*e+13*f+17*g+19*h+23*i+29*j+31*k+37*l+41*m+43*n1>n then goto 120
for o=0 to n/47
IF 2*a+3*b+5*c+7*d+11*e+13*f+17*g+19*h+23*i+29*j+31*k+37*l+41*m+43*n1+47*o>n then goto 110
for p=0 to n/53
IF 2*a+3*b+5*c+7*d+11*e+13*f+17*g+19*h+23*i+29*j+31*k+37*l+41*m+43*n1+47*o+53*p>n then goto 100
for q=0 to n/59
IF 2*a+3*b+5*c+7*d+11*e+13*f+17*g+19*h+23*i+29*j+31*k+37*l+41*m+43*n1+47*o+53*p+59*q>n then goto 90
for r=0 to n/61
IF 2*a+3*b+5*c+7*d+11*e+13*f+17*g+19*h+23*i+29*j+31*k+37*l+41*m+43*n1+47*o+53*p+59*q+61*r>n then goto 80
FOR t=0 TO n/67
IF 2*a+3*b+5*c+7*d+11*e+13*f+17*g+19*h+23*i+29*j+31*k+37*l+41*m+43*n1+47*o+53*p+59*q+61*r+67*t>n then goto 70
FOR u=0 TO n/71
IF 2*a+3*b+5*c+7*d+11*e+13*f+17*g+19*h+23*i+29*j+31*k+37*l+41*m+43*n1+47*o+53*p+59*q+61*r+67*t+71*u>n then goto 60
FOR v=0 TO n/73
IF 2*a+3*b+5*c+7*d+11*e+13*f+17*g+19*h+23*i+29*j+31*k+37*l+41*m+43*n1+47*o+53*p+59*q+61*r+67*t+71*u+73*v>n then goto 50
FOR w=0 TO n/79
IF 2*a+3*b+5*c+7*d+11*e+13*f+17*g+19*h+23*i+29*j+31*k+37*l+41*m+43*n1+47*o+53*p+59*q+61*r+67*t+71*u+73*v+79*w>n then goto 40
FOR x=0 TO n/83
IF 2*a+3*b+5*c+7*d+11*e+13*f+17*g+19*h+23*i+29*j+31*k+37*l+41*m+43*n1+47*o+53*p+59*q+61*r+67*t+71*u+73*v+79*w+83*x>n then goto 30
FOR y=0 TO n/89
IF 2*a+3*b+5*c+7*d+11*e+13*f+17*g+19*h+23*i+29*j+31*k+37*l+41*m+43*n1+47*o+53*p+59*q+61*r+67*t+71*u+73*v+79*w+83*x+89*y>n then goto 20
FOR z=0 TO n/97
IF 2*a+3*b+5*c+7*d+11*e+13*f+17*g+19*h+23*i+29*j+31*k+37*l+41*m+43*n1+47*o+53*p+59*q+61*r+67*t+71*u+73*v+79*w+83*x+89*y+97*z=n THEN LET s=s+1
10 next z
20 NEXT y
30 NEXT x
40 NEXT w
50 NEXT v
60 NEXT u
70 NEXT t
80 next r
90 next q
100 next p
110 NEXT o
120 NEXT n1
130 next m
140 next l
150 next k
160 next j
170 next i
180 next h
190 next g
200 next f
210 next e
220 next d
230 next c
240 next b
250 next a
PRINT s
PRINT TIME$
END

ためしに 87で
? 87
14:06:17
16681
14:06:27 
10秒で・・・
さらに数値を上げてこのプログラムの限界で 100 で
? 100
14:07:58
40899
14:08:29
31秒で・・・

で1000だとどうなるかは?
ですがこれはやめときます!!(∵疲れるから)
豊川市   4月25日(金) 14:14:14     53941
いちごみるく
f(x) = Π1/(1-x^p)
logf(x) = -Σlog(1-x^p)
f(x) = exp(-Σlog(1-x^p))
log(1-x^p)=-Σx^(ip)/i より
mod998244353上ならO(nlogn)で求まります。
   4月25日(金) 20:26:06     53942