A194352
First of quadruples of consecutive happy numbers.
Original entry on oeis.org
7839, 8739, 11248, 12148, 21148, 44488, 44489, 44939, 49439, 70839, 78039, 80739, 87039, 94439, 101248, 102148, 110248, 112048, 120148, 121048, 201148, 210148, 211048, 222688, 222689, 226288, 226289, 236839, 238639, 258598, 258599, 262288, 262289, 263839
Offset: 1
7839, 7840, 7841, 7842 are the first of four consecutive integers each of which is a happy number, hence a(1) = 7839.
-
f[n_] := Total[IntegerDigits[n]^2]; t = Select[Range[300000], NestWhile[f, #, UnsameQ, All] == 1 &]; t[[Select[Range[Length[t] - 3], t[[#]] == t[[# + 1]] - 1 == t[[# + 2]] - 2 == t[[# + 3]] - 3 &]]] (* T. D. Noe, Aug 22 2011 *)
A217705
Smallest number greater than 1 that is happy under bases 2 through n.
Original entry on oeis.org
2, 3, 3, 23, 79, 2207, 58775, 569669, 11814485, 210511543, 73748383237
Offset: 2
a(8) = 58775 because:
Base 2: 1110010110010111 - 1010 - 10 - 1,
Base 3: 2222121212 - 1011 - 10 - 1,
Base 4: 321121113 - 132 - 32 - 31 - 22 - 20 - 10 - 1,
Base 5: 3340100 - 120 - 10 - 1,
Base 6: 1132035 - 121 - 10 - 1,
Base 7: 333233 - 100 - 1,
Base 8: 162627 - 202 - 10 - 1,
Base 9 fails since the end is the 58 - 108 - 72 cycle and fails to reach 1.
-
ssd(n,b)=my(s);while(n,s+=(n%b)^2;n\=b);s
happy(k,b)=my(t=ssd(k,b));k=ssd(t,b);while(t!=k&&k>1,t=ssd(t,b);k=ssd(ssd(k,b),b));k==1
h3(k)=while(k>8, k=ssd(k,3));k==1 || k==3
a(n)=if(n<4,return(n));my(k=2);while(k++, if(!h3(k),next); for(b=5,n, if(!happy(k,b), next(2)));return(k)) \\ Charles R Greathouse IV, Mar 22 2013
A194355
First of quintuples of consecutive happy numbers.
Original entry on oeis.org
44488, 222688, 226288, 258598, 262288, 285598, 404488, 440488, 444088, 528598, 582598, 622288, 825598, 852598, 1113688, 1116388, 1131688, 1136188, 1161388, 1163188, 1233588, 1235388, 1253388, 1311688, 1316188, 1323588, 1325388, 1332588, 1335288, 1352388
Offset: 1
-
f[n_] := Total[IntegerDigits[n]^2]; t = Select[Range[1500000], NestWhile[f, #, UnsameQ, All] == 1 &]; t[[Select[Range[Length[t] - 3], t[[#]] == t[[# + 1]] - 1 == t[[# + 2]] - 2 == t[[# + 3]] - 3 == t[[# + 4]] - 4 &]]] (* T. D. Noe, Aug 24 2011 *)
Showing 1-3 of 3 results.
Comments