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.

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