A138858 a(n) = least square such that the subsets of {a(1),...,a(n)} sum to 2^n different values.
1, 4, 9, 16, 36, 81, 144, 324, 625, 1156, 2401, 4900, 9801, 19600, 39204, 78400, 156816, 313600, 627264, 1254400, 2509056, 5022081, 10042561, 20088324, 40182921, 80371225, 160731684, 321484900, 642977449, 1285939600, 2571909796, 5143901841, 10287842041, 20575607364, 41151368164, 82303003225, 164606284089, 329212012900, 658425136356, 1316850346681, 2633700545424, 5267401386724
Offset: 1
Keywords
Examples
Up to a(4)=16, we have a(n)=n^2. But since 5^2=25=9+16 is already represented as sum of earlier terms, this is excluded, while a(5)=6^2=36 has the required property. Obviously, any square larger to the sum of all preceding terms leads to enough new terms, thus a(n) <= floor( sqrt( sum(a(k),k=1..n-1))+1)^2. But in contrast to A064934, such a simple formula (with equality) cannot be used here: a(7)=12^2=144 < 147=sum(a(k),k<7) and also a(10)=sum(a(k),k<10)-84.
Links
- Martin Fuller, Table of n, a(n) for n = 1..1000
- Martin Fuller, PARI program
Programs
-
PARI
{s=1;p=0; for( n=1,20, until( !bitand( s, s>>(p^2) ), p++); s+=s<<(p^2); print1( p^2,","))}
Extensions
a(24)-a(30) from Donovan Johnson, Oct 03 2009
a(31) onwards from Martin Fuller, Apr 07 2025
Comments