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-8 of 8 results.

A376272 Elated numbers: numbers whose trajectory under iteration of the A376270 map includes 1.

Original entry on oeis.org

1, 10, 13, 21, 43, 51, 67, 77, 88, 92, 97, 100, 103, 117, 124, 130, 142, 155, 171, 201, 210, 226, 237, 256, 262, 265, 273, 319, 322, 337, 356, 365, 373, 391, 403, 430, 438, 483, 501, 510, 514, 541, 556, 565, 579, 588, 597, 607, 616, 639, 661, 668, 670, 686, 693, 699, 707, 717, 724, 742, 746
Offset: 1

Views

Author

Michel Marcus, Sep 18 2024

Keywords

Crossrefs

b-elated numbers: A000027 (2), A376272 (10).

Programs

  • Maple
    b:= proc(n) b(n):= (l-> l[-1]*add(i^2, i=l))(convert(n, base, 10)) end:
    q:= proc(n) option remember; local k, s; k, s:= n, {};
          while not (k=1 or k in s) do s, k:= {s[], k}, b(k) od: is(k=1)
        end:
    select(q, [$1..1000])[];  # Alois P. Heinz, Sep 18 2024
  • PARI
    f(n) = if (n, my(d=digits(n)); d[1]*norml2(d), 0); \\ A376270
    isok(n) = my(list=List()); while(1, my(m=f(n)); if (m==1, return(1)); if (#select(x->(x==m), Vec(list)), return(0)); listput(list, m); n=m); 0;
    
  • Python
    def f(n): return (d:=list(map(int, str(n))))[0] * sum(di*di for di in d)
    def ok(n):
        if n == 1: return True
        traj = {n}
        while (n:=f(n)) not in traj: traj.add(n)
        return 1 in traj
    print([k for k in range(750) if ok(k)]) # Michael S. Branicky, Sep 18 2024

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

Views

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.

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.

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.

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

A376273 a(n) is the smallest elated number of height n.

Original entry on oeis.org

1, 10, 13, 51, 67, 97, 668, 77, 746, 92, 717, 5369, 8888999999
Offset: 0

Author

Michel Marcus, Sep 18 2024

Keywords

Comments

a(13) = 8158 * 10^13888887 - 1, per Fox et al., which is too large to include. - Michael S. Branicky, Sep 18 2024

Crossrefs

Cf. A376270 (map), A376272 (elated numbers).
A007013 is the analog for base 2 (with shifted offset).

Programs

  • PARI
    f(n) = if (n, my(d=digits(n)); d[1]*norml2(d), 0); \\ A376270
    g(n) = my(list=List()); listput(list, n); while(1, my(m=f(n)); if (m==1, return(#list)); if (#select(x->(x==m), Vec(list)), return(0)); listput(list, m); n=m); -1;
    a(n) = if (n==0, 1, my(k=2); while(g(k) != n, k++); k);
    
  • Python
    from itertools import count, islice, combinations_with_replacement as mc
    def f(n): return (d:=list(map(int, str(n))))[0] * sum(di*di for di in d)
    def iters(n):
        if n == 1: return 0
        traj, c = {n}, 0
        while (n:=f(n)) not in traj: traj.add(n); c += 1
        return c if 1 in traj else float('inf')
    def bgen():
        yield from (int(f+"".join(m)) for d in count(1) for f in "123456789" for m in mc("0123456789", d-1))
    def agen(): # generator of terms
        adict, n = dict(), 0
        for k in bgen():
            v = iters(k)
            if v not in adict:
                adict[v] = k
                while n in adict: yield adict[v]; n += 1
    print(list(islice(agen(), 13))) # Michael S. Branicky, Sep 18 2024

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

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
Showing 1-8 of 8 results.