cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-3 of 3 results.

A161874 Bases with smallest unhappy number (in that base) > 2.

Original entry on oeis.org

16, 18, 20, 30, 130, 256, 1042, 4710, 7202, 10082, 47274, 65536, 65600, 351634, 426530, 431730, 764930, 5921514, 26639560, 32435910, 88605010, 97025190, 99562110
Offset: 1

Views

Author

Jud McCranie, Jun 20 2009

Keywords

Comments

a(12) > 50000, if it exists. - Amiram Eldar, Jun 16 2020
a(18) > 1.5*10^6, if it exists. The smallest unhappy numbers corresponding to bases a(1)-a(17) are 3, 7, 3, 5, 20, 3, 12, 3, 3, 14, 3, 3, 3, 3, 3, 3, 23. - Giovanni Resta, Jun 25 2020
The smallest unhappy numbers in bases (a(18), ..., a(23)) are (3, 23, 3, 261, 6, 12). - Lucas A. Brown, Apr 25 2023
a(24) > 10^8, if it exists. - Lucas A. Brown, Apr 25 2023

Examples

			In base 16, 2 is happy because the sequence it generates is 2 -> 4 -> (1,0) -> 1, while 3 is unhappy because the sequence it generates is 3 -> 9 -> (5,1) -> (1,10) -> (6,5) -> (3,13) -> (11,2) -> (7,13) -> (13,10) -> (1,0,13) -> (10,10) -> (12,8) -> (13,0) -> (10,9) -> (11,5) -> (9,2) -> (5,5) -> (3,2) -> (0,13) -> (10,9) -> ..., which repeats with period 6.
		

Crossrefs

Cf. A031177 (unhappy numbers in base 10), A161872, A362026.

Programs

  • Mathematica
    happyQ[n_, b_] := NestWhile[Total[IntegerDigits[#, b]^2] &, n, UnsameQ, All] == 1; Select[Range[2, 256], !MemberQ[{2, 4}, #] && happyQ[2, #] &] (* Amiram Eldar, Jun 16 2020 *)

Extensions

a(11) from Amiram Eldar, Jun 16 2020
a(12)-a(17) from Giovanni Resta, Jun 25 2020
a(18) from Lucas A. Brown, Aug 17 2022
a(19) from Lucas A. Brown, Aug 26 2022
a(20)-a(23) from Lucas A. Brown, Apr 25 2023

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

Views

Author

Sergio Pimentel, Mar 20 2013

Keywords

Comments

A happy number is a number that after iteration of sum of squares of digits eventually reaches 1 (A007770). The happy property is base-dependent. This sequence lists the smallest number that is happy in bases 2, 3, ..., n.
All numbers are happy in binary and base 4.

Examples

			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.
		

Crossrefs

Programs

  • PARI
    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

Extensions

a(9)-a(12) from Giovanni Resta, Mar 21 2013

A362026 Smallest unhappy number in base A161874(n).

Original entry on oeis.org

3, 7, 3, 5, 20, 3, 12, 3, 3, 14, 3, 3, 3, 3, 3, 3, 23, 3, 23, 3, 261, 6, 12
Offset: 1

Views

Author

Lucas A. Brown, Apr 26 2023

Keywords

Comments

This sequence is the list of least unhappy numbers (A161872) with all terms < 3 removed.

Examples

			The first term in this sequence corresponds to base 16.  In base 16, 2 is happy because the sequence it generates is 2 -> 4 -> (1,0) -> 1, while 3 is unhappy because the sequence it generates is 3 -> 9 -> (5,1) -> (1,10) -> (6,5) -> (3,13) -> (11,2) -> (7,13) -> (13,10) -> (1,0,13) -> (10,10) -> (12,8) -> (13,0) -> (10,9) -> (11,5) -> (9,2) -> (5,5) -> (3,2) -> (0,13) -> (10,9) -> ..., which repeats with period 6.
		

Crossrefs

Formula

a(n) = A161872(A161874(n)).
Showing 1-3 of 3 results.