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: Philippe Guglielmetti

Philippe Guglielmetti's wiki page.

Philippe Guglielmetti has authored 2 sequences.

A318530 Numbers that can be written in more than one way as p^2 + q^3 + r^4 with p, q and r primes.

Original entry on oeis.org

145, 210, 637, 754, 2317, 2530, 2917, 5218, 5437, 5890, 6447, 6997, 7469, 7653, 7738, 8650, 9333, 11818, 12417, 12796, 14770, 15178, 15197, 15295, 15513, 16349, 16501, 17367, 18389, 19709
Offset: 1

Author

Philippe Guglielmetti, Aug 28 2018

Keywords

Examples

			a(1) = 145 = 2^2 + 5^3 + 2^4 = 11^2 + 2^3 + 2^4 .
The first term which can be written in three different ways is
17367 = 23^2 + 13^3 + 11^4 = 113^2 + 13^3 + 7^4 = 131^2 + 5^3 + 3^4 .
		

Crossrefs

Subset of A134657.

Programs

  • Maple
    N:= 10^5: # to get terms <= N
    P:= select(isprime, [2,seq(i,i=3..floor(sqrt(N)))]):
    Psq:= map(`^`,P,2):
    P3:= select(`<=`,map(`^`,P,3),N):
    P4:= select(`<=`,map(`^`,P,4),N):
    V:= Vector(N):
    for a in Psq do for b in P3 do for c in P4 do
       s:= a+b+c;
       if s <= N then V[s]:= V[s]+1 fi
    od od od:
    select(t -> V[t]>=2, [$1..N]); # Robert Israel, Jan 30 2019

A303935 Size of orbit of n under repeated application of sum of factorial of digits of n.

Original entry on oeis.org

2, 1, 1, 16, 8, 10, 15, 32, 36, 35, 2, 2, 17, 33, 13, 10, 15, 32, 36, 35, 17, 17, 9, 37, 7, 12, 6, 8, 33, 31, 33, 33, 37, 18, 34, 31, 48, 39, 24, 8, 13, 13, 7, 34, 30, 54, 42, 39, 29, 52, 10, 10, 12, 31, 54, 10, 24, 21, 41, 24, 15, 15, 6, 48, 42, 24, 12, 42
Offset: 0

Author

Philippe Guglielmetti, May 03 2018

Keywords

Comments

Numbers n for which a(n)=1 are called factorions (A014080).
Apart from factorions, only 3 cycles exist:
169 -> 363601 -> 1454 -> 169, so a(169) = a(363601) = a(1454) = 3.
871 -> 45361 -> 871, so a(871) = a(45361) = 2.
872 -> 45362 -> 872, so a(872) = a(45362) = 2.
All other n produce a chain reaching either a factorion or a cycle.

Examples

			For n = 4, 4!=24, 2!+4!=26, 2!+6!=722, 7!+2!+2!=5044, 5!+0!+4!+4!=169, 1!+6!+9!=363601, 3!+6!+3!+6!+0!+1!=1454, then 1!+4!+5!+4!=169 which already belongs to the chain, so a(4) = length of [4, 24, 26, 722, 5044, 169, 363601, 1454] = 8.
		

Crossrefs

Cf. A061602, A014080 (contains n for which a(n) = 1).

Programs

  • Mathematica
    Array[Length@ NestWhileList[Total@ Factorial@ IntegerDigits@ # &, #, UnsameQ, All, 100, -1] &, 68, 0] (* Michael De Vlieger, May 10 2018 *)
  • PARI
    f(n) = if (!n, n=1); my(d=digits(n)); sum(k=1, #d~, d[k]!);
    a(n) = {my(v = [n], vs = Set(v)); for (k=1, oo, new = f(n); if (vecsearch(vs, new), return (#vs)); v = concat(v, new); vs = Set(v); n = new;);} \\ Michel Marcus, May 18 2018
  • Python
    for n in count(0):
        l=[]
        i=n
        while i not in l:
            l.append(i)
            i=sum(map(factorial,map(int,str(i))))
        print(n,len(l))