OFFSET
1,3
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
MAPLE
A242667 := proc(n)
a := 0 ;
for i from 1 do
if A005117(i) > n then
return a;
end if;
for k from i do
su := add(A005117(s), s=i..k) ;
if su = n then
a := a+1 ;
elif su > n then
break;
fi ;
end do:
end do:
end proc:
seq(A242667(n), n=1..80) ; # R. J. Mathar, Jun 12 2014
# Alternative:
N:= 1000:# to get the first N entries
A005117:= select(numtheory:-issqrfree, [$1..N]):
M:= nops(A005117);
A:= Array(1..N):
t0:= 0:
for n from 1 to M-1 do
t0:= t0 + A005117[n];
t:= t0;
for i from 1 while t <= N do
A[t] := A[t]+1;
if n+i > M then break fi;
od;
od:
seq(A[i], i=1..N); # Robert Israel, Jun 25 2014
MATHEMATICA
With[{N = 100}, (* to get the first N entries *)
A005117 = Select[Range[N], SquareFreeQ];
M = Length[A005117];
A = Table[0, {N}];
t0 = 0;
For[n = 1, n <= M-1, n++,
t0 = t0+A005117[[n]];
t = t0;
For[i = 1, t <= N, i++,
A[[t]] = A[[t]]+1;
If[n+i > M, Break[]];
]
];
A (* Jean-François Alcover, Feb 07 2023, after Robert Israel *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Irina Gerasimova, May 20 2014
STATUS
approved