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

A072921 a(1)=1; a(n) = a(n-1) + [sum of all decimal digits present so far in the sequence].

Original entry on oeis.org

1, 2, 5, 13, 25, 44, 71, 106, 148, 203, 263, 334, 415, 506, 608, 724, 853, 998, 1169, 1357, 1561, 1778, 2018, 2269, 2539, 2828, 3137, 3460, 3796, 4157, 4535, 4930, 5341, 5765, 6212, 6670, 7147, 7643, 8159, 8698, 9268, 9863, 10484, 11122
Offset: 1

Views

Author

N. J. A. Sloane, Oct 07 2009, based on a posting to the Sequence Fans Mailing List by Eric Angelini, Oct 01 2009

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; local m;
          m:= a(n);
          `if`(n=1, 0, b(n-1));
           while m>0 do %+ irem(m, 10, 'm') od; %
        end:
    a:= proc(n) option remember;
          `if`(n=1, 1, a(n-1) +b(n-1))
        end:
    seq(a(n), n=1..50); # Alois P. Heinz, Jun 01 2010
  • Mathematica
    a[1]=1;a[2]=2;a[n_]:=a[n]=2*a[n-1]-a[n-2]+Apply[Plus,IntegerDigits[a[n-1]]];Table[a[n],{n,100}] (* Farideh Firoozbakht, Oct 01 2009 *)
    a[1] = 1; a[n_] := a[n] = a[n - 1] + Plus @@ Flatten[ Map[ IntegerDigits, Array[a, n - 1]]]; Array[a, 100] (* Robert G. Wilson v, Oct 01 2009 *)
  • Python
    from itertools import islice
    def agen(): # generator of terms
        an, anp1 = 1, 2
        while True:
            yield an
            an, anp1 = anp1, 2*anp1 - an + sum(map(int, str(anp1)))
    print(list(islice(agen(), 44))) # Michael S. Branicky, Oct 01 2024

Formula

a(1)=1, a(2)=2; a(n+1)=2a(n)-a(n-1)+sod(a(n)) (sod = "sum of digits"). - Farideh Firoozbakht, Oct 01 2009
Asymptotically it seems a(n)~c*n^2*log(n) for c~1.99... - Benoit Cloitre, Oct 07 2009

Extensions

More terms from Alois P. Heinz, Oct 01 2009

A152220 Primes p such that p^2 divides m!-1 for some integer m < p.

Original entry on oeis.org

11, 31, 107, 571, 971, 4931
Offset: 1

Views

Author

Artur Jasinski, Nov 29 2008

Keywords

Comments

For numbers k such that k! - 1 is divisible by a square see A152219.
a(7) > 60000, if it exists. - Amiram Eldar, Oct 23 2024

Crossrefs

Programs

  • Mathematica
    aa = {}; Do[If[(Sqrt[n! - 1] /. Sqrt[] -> 1) > 1, Print[(Sqrt[n! - 1] /. Sqrt[] -> 1)]; AppendTo[aa, (Sqrt[n! - 1] /. Sqrt[_] -> 1)]], {n, 1, 1000}]; aa
    q[p_] := Module[{m = 2}, While[m < p && ! Divisible[m! - 1, p^2], m++]; Divisible[m! - 1, p^2]]; Select[Prime[Range[660]], q] (* Amiram Eldar, Oct 23 2024 *)
  • PARI
    is(p) = if(isprime(p), my(m = 2); while(m < p && (m! - 1) % (p^2), m++); !((m! - 1) % (p^2)), 0); \\ Amiram Eldar, Oct 23 2024

Extensions

a(6) from Artur Jasinski, Nov 30 2008
Showing 1-2 of 2 results.