OFFSET
1,3
COMMENTS
2 and 3 appear only once since the only way they can be expressed as the sum of squares is as 2 = 1^2 + 1^2 and 3 = 1^2 + 1^2 + 1^2 (see Example). Maximum number of times prime(k) can appear is A379551(k).
Conjecture: Every positive integer appears in the sequence at least once.
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
Michael De Vlieger, Log log scatterplot of a(n), n = 1..2^20.
EXAMPLE
a(2) = 1^2 = 1 so a(3) = 2 since 1 has occurred twice. This is the only occasion of a(n) = 2 in the sequence. Because a(3) = 2 is a novel term, a(4) = 2^2 = 4, then a(5) = 4^2 = 16.
a(8) = a(18) = 89, so a(19) = 2*89 = 178.
a(28) = 10, a novel term, so a(29) = 1, the 3rd occurrence of 1, so a(30) = 3 (the only occasion of 3 in the sequence).
MATHEMATICA
nn = 120; c[_] := 0; a[1] = j = 1;
Do[If[c[j] == 0,
k = Total[IntegerDigits[j]^2]; c[j]++,
k = ++c[j]*j ];
Set[{a[n], j}, {k, k}], {n, 2, nn}];
Array[a, nn] (* Michael De Vlieger, Dec 25 2024 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
David James Sycamore, Dec 24 2024
STATUS
approved
