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.

User: Nathan Fox

Nathan Fox's wiki page.

Nathan Fox has authored 176 sequences. Here are the ten most recent ones:

A375212 a(n) is the product of the leading base-3 digit of n and the sum of the squares of its base-3 digits.

Original entry on oeis.org

1, 8, 1, 2, 5, 8, 10, 16, 1, 2, 5, 2, 3, 6, 5, 6, 9, 8, 10, 16, 10, 12, 18, 16, 18, 24, 1, 2, 5, 2, 3, 6, 5, 6, 9, 2, 3, 6, 3, 4, 7, 6, 7, 10, 5, 6, 9, 6, 7, 10, 9, 10, 13, 8, 10, 16, 10, 12, 18, 16, 18, 24, 10, 12, 18, 12, 14, 20, 18, 20, 26, 16, 18, 24, 18, 20
Offset: 1

Author

N. Bradley Fox, Nathan Fox, Helen Grundman, Rachel Lynn, Changningphaabi Namoijam, Mary Vanderschoot, Oct 16 2024

Keywords

Crossrefs

A377089 Numbers that are both happy (A007770) and elated (A376272).

Original entry on oeis.org

1, 10, 13, 97, 100, 103, 130, 226, 262, 319, 356, 365, 391, 556, 565, 907, 970, 1000, 1003, 1030, 1122, 1177, 1188, 1212, 1221, 1222, 1277, 1300, 1339, 1393, 1448, 1478, 1484, 1487, 1557, 1575, 1717, 1727, 1748, 1755, 1771, 1772, 1784, 1818, 1844, 1847, 1874
Offset: 1

Author

N. Bradley Fox, Nathan Fox, Helen Grundman, Rachel Lynn, Changningphaabi Namoijam, Mary Vanderschoot, Oct 15 2024

Keywords

Comments

Every power of 10 is in this sequence, as both the sum of squared digits map (A003132) and the map A376270 map powers of 10 to 1.

Crossrefs

Programs

  • Python
    def ssd(n): return sum(int(d)**2 for d in str(n))
    def f(n): return (d:=list(map(int, str(n))))[0] * sum(di*di for di in d)
    def happy(n):
        if n == 1: return True
        s = list(map(int, str(n)))
        while n not in [1, 4]: n = ssd(n) # iterate until fixed point or cycle
        return n == 1
    def elated(n):
        if n == 1: return True
        traj = {n}
        while (n:=f(n)) not in traj: traj.add(n)
        return 1 in traj
    def ok(n): return happy(n) and elated(n)
    print([k for k in range(1, 2001) if ok(k)]) # Michael S. Branicky, Oct 16 2024

A377088 Number of attractors under iteration of the map sending a positive integer to the product of its leading base-n digit and the sum of the squares of its base-n digits.

Original entry on oeis.org

1, 5, 2, 3, 8, 6, 11, 4, 16, 14, 23, 18, 42, 7, 24, 34, 26, 58, 98, 51, 99, 88, 51, 57, 103, 72, 89, 60, 69, 35, 78, 146, 39, 90, 73, 11, 109, 113, 71, 156, 220, 93, 176, 101, 132, 172, 187, 10, 160, 95, 221, 226, 69, 55, 163, 110, 137, 287, 168, 69, 260, 194, 208
Offset: 2

Author

N. Bradley Fox, Nathan Fox, Helen Grundman, Rachel Lynn, Changningphaabi Namoijam, Mary Vanderschoot, Oct 15 2024

Keywords

Comments

If b>=2 and a>=b^3 then E(a,2,b)

Examples

			In the decimal system all integers go to (1), (298), (46, 208, 136), (26, 80, 512, 150), or (33, 54, 205, 58, 445, 228, 144) under iteration of the map A376270, hence there are two fixed points, one 3-cycle, one 4-cycle, and one 7-cycle. Therefore a(10) = 1 + 1 + 3 + 4 + 7 = 16.
		

Crossrefs

A193586 is the analog for happy numbers.

A377087 Number of cycles under iteration of the map sending a positive integer to the product of its leading base-n digit and the sum of the squares of its base-n digits.

Original entry on oeis.org

0, 1, 0, 1, 2, 1, 2, 0, 3, 2, 5, 2, 4, 1, 3, 3, 3, 2, 3, 4, 1, 5, 3, 7, 2, 3, 3, 3, 4, 4, 5, 3, 6, 12, 2, 1, 3, 2, 6, 10, 4, 8, 6, 3, 4, 2, 3, 1, 3, 4, 9, 3, 2, 2, 5, 7, 4, 8, 7, 5, 6, 6, 6, 1, 8, 7, 4, 6, 6, 2, 5, 7, 5, 5, 4, 5, 3, 4, 3, 5, 2, 4, 7, 8, 3, 7, 7
Offset: 2

Author

N. Bradley Fox, Nathan Fox, Helen Grundman, Rachel Lynn, Changningphaabi Namoijam, Mary Vanderschoot, Oct 15 2024

Keywords

Comments

If b>=2 and a>=b^3 then E(a,2,b)

Examples

			In the decimal system all integers go to (1), (298), (46, 208, 136), (26, 80, 512, 150), or (33, 54, 205, 58, 445, 228, 144) under iteration of the map A376270, hence there are two fixed points and three cycles. Therefore a(10) = 3.
		

Crossrefs

A193585 is the analog for happy numbers.

A377086 Number of fixed points under iteration of the map sending a positive integer to the product of its leading base-n digit and the sum of the squares of its base-n digits.

Original entry on oeis.org

1, 2, 2, 1, 1, 4, 3, 4, 2, 3, 1, 3, 5, 2, 4, 4, 2, 4, 1, 3, 3, 3, 1, 5, 2, 3, 5, 4, 4, 9, 2, 1, 1, 4, 2, 6, 4, 1, 2, 5, 3, 6, 3, 1, 2, 3, 1, 7, 2, 1, 3, 3, 1, 5, 4, 6, 5, 4, 2, 8, 3, 2, 7, 3, 1, 4, 4, 2, 3, 6, 3, 9, 2, 3, 4, 9, 3, 7, 3, 2, 6, 5, 1, 7, 3, 3, 3
Offset: 2

Author

N. Bradley Fox, Nathan Fox, Helen Grundman, Rachel Lynn, Changningphaabi Namoijam, Mary Vanderschoot, Oct 15 2024

Keywords

Comments

If b>=2 and a>=b^3 then E(a,2,b)
Unlike the related sequence A193583, which contains only odd numbers, this sequence contains even numbers and odd numbers.

Examples

			In the decimal system all integers go to (1), (298), (46, 208, 136), (26, 80, 512, 150), or (33, 54, 205, 58, 445, 228, 144) under iteration of the map A376270, hence there are two fixed points and three cycles. Therefore a(10) = 2.
		

Crossrefs

A193583 is the analog for happy numbers.

A377085 a(n) = floor(A377084(n)/(n-1)^2).

Original entry on oeis.org

0, 1, 1, 5, 5, 6, 5, 6, 8, 9, 7, 11, 12, 11, 11, 14, 15, 16, 14, 16, 18, 18, 15, 22, 23, 20, 18, 27, 24, 23, 22, 28, 27, 27, 23, 31, 30, 28, 24, 35, 33, 32, 27, 34, 34, 34, 30, 40, 39, 36, 32, 40, 39, 40, 35, 44, 43, 42, 35, 45, 46, 43, 38, 51, 47, 47, 41, 49, 50
Offset: 3

Author

N. Bradley Fox, Nathan Fox, Helen Grundman, Rachel Lynn, Changningphaabi Namoijam, Mary Vanderschoot, Oct 15 2024

Keywords

Crossrefs

Cf. A377084.

A377084 a(n) is the maximum integer for which some minimum-length sum equaling a(n) of perfect squares less than n^2 excludes (n-1)^2.

Original entry on oeis.org

3, 16, 31, 128, 191, 324, 368, 561, 891, 1200, 1104, 1993, 2535, 2692, 2896, 4321, 4880, 5832, 5776, 7485, 9144, 9680, 8903, 14353, 15576, 14872, 14527, 22736, 21697, 22500, 22587, 30537, 31451, 33524, 30076, 42768, 43664, 43097, 39317, 59200, 58835, 59893
Offset: 3

Author

N. Bradley Fox, Nathan Fox, Helen Grundman, Rachel Lynn, Changningphaabi Namoijam, Mary Vanderschoot, Oct 15 2024

Keywords

Examples

			561 cannot be written as a sum of fewer than nine perfect squares less than 10^2. 561 can be written as a sum of nine of these numbers in five ways:
561 = 1^2 + 5^2 + 7^2 + 9^2 + 9^2 + 9^2 + 9^2 + 9^2 + 9^2
561 = 3^2 + 6^2 + 8^2 + 8^2 + 8^2 + 9^2 + 9^2 + 9^2 + 9^2
561 = 3^2 + 7^2 + 7^2 + 7^2 + 9^2 + 9^2 + 9^2 + 9^2 + 9^2
561 = 5^2 + 5^2 + 5^2 + 9^2 + 9^2 + 9^2 + 9^2 + 9^2 + 9^2
561 = 7^2 + 8^2 + 8^2 + 8^2 + 8^2 + 8^2 + 8^2 + 8^2 + 8^2
The last sum here does not include 9^2, so a(10) >= 561. In fact, a(10) = 561, as every number larger than 561 has 9^2 in every shortest decomposition of this form.
		

Crossrefs

Cf. A377085.

A377083 Number of iterations required for elated number A376272(n) to converge to 1.

Original entry on oeis.org

0, 1, 2, 2, 2, 3, 4, 7, 4, 9, 5, 1, 2, 4, 3, 2, 3, 4, 4, 2, 2, 5, 4, 3, 5, 3, 4, 5, 4, 3, 3, 3, 3, 5, 2, 2, 4, 4, 3, 3, 3, 3, 3, 3, 7, 9, 7, 4, 5, 9, 5, 6, 4, 6, 9, 4, 7, 10, 5, 5, 8, 10, 8, 6, 8, 8, 7, 10, 6, 4, 5, 6, 7, 6, 2, 5, 7, 2, 7, 4, 7, 9, 5, 9, 5, 5
Offset: 1

Author

N. Bradley Fox, Nathan Fox, Helen Grundman, Rachel Lynn, Changningphaabi Namoijam, Mary Vanderschoot, Oct 15 2024

Keywords

Examples

			21 is the 4th elated number and iterating the map A376270 yields 10 then 1, so a(4)=2.
		

Crossrefs

A090425 is the analog for happy numbers, with a different convention used.

Programs

  • Python
    from itertools import count, islice
    def f(n): return (d:=list(map(int, str(n))))[0] * sum(di*di for di in d)
    def ok_count(n):
        if n == 1: return True, 0
        traj, c = {n}, 0
        while (n:=f(n)) not in traj: traj.add(n); c += 1
        return 1 in traj, c
    def agen(): # generator of terms
        for n in count(1):
            elated, iterations = ok_count(n)
            if elated: yield iterations
    print(list(islice(agen(), 90))) # Michael S. Branicky, Oct 16 2024

A377082 a(0) = 1, a(1) = 3, a(2) = 13; for n >= 2, a(n+1) = 2*3^((a(n)-1)/4) - 1.

Original entry on oeis.org

1, 3, 13, 53, 3188645
Offset: 0

Author

N. Bradley Fox, Nathan Fox, Helen Grundman, Rachel Lynn, Changningphaabi Namoijam, Mary Vanderschoot, Oct 15 2024

Keywords

Comments

The next term is too large to include.
a(n) is the least positive integer that requires n steps to reach 1 under iteration of the sum of squares of digits function in base 3 (A006287).
a(n) is also the least positive integer that requires n steps to reach 1 under iteration of the map A375212.

Crossrefs

A373239 Relative of Hofstadter Q-sequence: a(n) = max(0, n+118) for n <= 0; a(n) = a(n-a(n-1)) + a(n-a(n-2)) + a(n-a(n-3)) for n > 0.

Original entry on oeis.org

6, 119, 120, 121, 9, 122, 123, 124, 12, 125, 126, 127, 15, 128, 129, 17, 131, 18, 131, 133, 134, 22, 21, 247, 241, 9, 18, 256, 259, 127, 22, 148, 153, 131, 27, 36, 155, 246, 122, 39, 156, 162, 126, 42, 158, 165, 16, 157, 165, 145, 40, 157, 55, 260, 134, 46, 167, 178, 25, 38, 58, 523, 250, 122, 61, 71, 299, 238, 116, 72, 190, 192
Offset: 1

Author

Nathan Fox, May 28 2024

Keywords

Comments

Sequences like this are more naturally considered with the first nonzero term in position 1. But this sequence would then match A000027 for its first 118 terms.
This sequence has exactly 127 terms (of positive index). a(127) = 0, so an attempt to calculate a(128) would refer to itself.
Without the convention that a(n) = 0 for n <= -118, this sequence would have exactly 24 terms (of positive index), since computing a(25) refers to a(-222).
If 118 in this sequence's definition is replaced by any larger number congruent to 6 mod 7, the behavior is essentially the same, though the quasilinear part (see Formula section) lasts longer.

Formula

If the index is between 67 and 118 (inclusive), then a(7n) = 7n+2, a(7n+1) = 7n+120, a(7n+2) = 7n+122, a(7n+3) = 7, a(7n+4) = 2n+281, a(7n+5) = n+229, a(7n+6) = 116.