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

A340594 a(n) is the number of iterations of A340592 starting from n, until 0, 1 or a prime is reached.

Original entry on oeis.org

0, 0, 1, 0, 1, 0, 2, 2, 1, 0, 1, 0, 1, 1, 2, 0, 1, 0, 1, 3, 1, 0, 2, 1, 1, 3, 1, 0, 2, 0, 2, 2, 1, 2, 1, 0, 1, 1, 2, 0, 4, 0, 1, 2, 2, 0, 1, 2, 1, 1, 1, 0, 1, 3, 1, 2, 4, 0, 2, 0, 3, 2, 2, 5, 1, 0, 1, 1, 1, 0, 3, 0, 2, 4, 2, 2, 2, 0, 6, 2, 3, 0, 1, 1, 1, 2, 3, 0, 2, 3, 2, 2, 1, 2, 1, 0, 3, 2
Offset: 2

Views

Author

J. M. Bergot and Robert Israel, Jan 13 2021

Keywords

Comments

a(n) = 0 if n is prime.

Examples

			A340592(21) = 16, A340592(16) = 14, A340592(14) = 13 is prime, so a(21) = 3.
		

Crossrefs

Programs

  • Maple
    dcat:= proc(L) local i, x;
      x:= L[-1];
      for i from nops(L)-1 to 1 by -1 do
        x:= 10^(1+ilog10(x))*L[i]+x
      od;
      x
    end proc:
    f:= proc(n) local F;
      F:= sort(ifactors(n)[2], (a, b) -> a[1] < b[1]);
      dcat(map(t -> t[1]$t[2], F)) mod n;
    end proc:
    g:= proc(n) option remember;
         if isprime(n) then 0 else 1 + procname(f(n)) fi
    end proc:
    g(0):= 0: g(1):= 0:
    map(g, [$1..1000]);

Formula

a(n) = A066247(n)*(1 + a(A340592(n))).

A350836 Numbers k such that A103168(k) = A340592(k).

Original entry on oeis.org

1, 2, 3, 5, 7, 11, 14, 50, 101, 131, 151, 181, 191, 194, 313, 353, 373, 383, 712, 727, 757, 762, 787, 797, 919, 929, 1100, 1994, 2701, 4959, 10301, 10501, 10601, 11311, 11411, 12421, 12721, 12821, 13331, 13831, 13931, 14341, 14741, 15451, 15551, 16061, 16361, 16561, 16661, 17471, 17971, 18181
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Jan 17 2022

Keywords

Comments

Numbers k such that the concatenation of the prime factors of k with multiplicity is congruent mod k to the reverse of k.
Terms for which the common value of A103168(k) and A340592(k) is prime include 14, 50, 194, 1100, and 116416.

Examples

			a(7) = 14 is a term because A103168(14) = 41 mod 14 = 13 and A340592(14) = 27 mod 14 = 13.
		

Crossrefs

Programs

  • Maple
    revdigs:= proc(n) local L,i;
      L:= convert(n,base,10);
      add(L[-i]*10^(i-1),i=1..nops(L))
    end proc:
    f:= proc(n) local L,p,i,r;
      L:= sort(map(t -> t[1]$t[2],ifactors(n)[2]));
      r:= L[1];
      for i from 2 to nops(L) do r:= r*10^(1+max(0,ilog10(L[i])))+L[i] od;
      r
    end proc:
    f(1):= 1:
    select(n -> (f(n) - revdigs(n)) mod n = 0, [$1..20000]);
  • Python
    from sympy import factorint
    def A103168(n):
        return int(str(n)[::-1])%n
    def A340592(n):
        if n == 1: return 0
        return int("".join(str(f) for f in factorint(n, multiple=True)))%n
    def ok(n):
        return A103168(n) == A340592(n)
    print([k for k in range(1, 20000) if ok(k)]) # Michael S. Branicky, Jan 18 2022

A340595 a(n) is the least k for which A340594(k) = n.

Original entry on oeis.org

2, 4, 8, 21, 42, 65, 80, 217, 488, 721, 2120, 2349, 2796, 9214, 16043, 23287, 28626, 43588, 58176, 116982, 213435, 444329, 640673, 967248, 1399895, 1449156, 1528785, 2768054, 2915135, 3631071, 3673118, 5032731, 12977420
Offset: 0

Views

Author

J. M. Bergot and Robert Israel, Jan 13 2021

Keywords

Comments

a(n) is the least k >= 2 from which it takes exactly n iterations of A340592 to reach 0, 1 or a prime.

Examples

			Starting from 21, it takes 3 iterations of A340592 to reach 0,1 or a prime: 21 -> 16 -> 14 -> 13.  Since this is the first case where 3 iterations are required, a(3) = 21.
		

Crossrefs

Programs

  • Maple
    dcat:= proc(L) local i, x;
      x:= L[-1];
      for i from nops(L)-1 to 1 by -1 do
        x:= 10^(1+ilog10(x))*L[i]+x
      od;
      x
    end proc:
    f:= proc(n) local F;
      F:= sort(ifactors(n)[2], (a, b) -> a[1] < b[1]);
      dcat(map(t -> t[1]$t[2], F)) mod n;
    end proc:
    g:= proc(n) option remember;
         if isprime(n) then 0 else 1 + procname(f(n)) fi
    end proc:
    g(0):= 0: g(1):= 0:
    V:= Array(0..30): count:= 0:
    for n from 2 while count < 31 do
      v:= f(n);
      if v::integer and v <= 100 and V[v] = 0 then
          count:= count+1; V[v]:= n;
        fi
    od:
    convert(V,list);

A350850 Members of A350836 that are not in A002385.

Original entry on oeis.org

1, 14, 50, 194, 712, 762, 1100, 1994, 2701, 4959, 58376, 70478, 111538, 116416, 144080, 158736, 712410, 1319216, 1934075, 7709760, 10228166, 11601194, 94663994, 177930006
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Jan 18 2022

Keywords

Comments

Numbers k that are not palindromic primes, such that the concatenation of the prime factors of k with multiplicity is congruent mod k to the reverse of k.

Examples

			a(3) = 50 is a term because A103168(50) = 5 mod 50 = 5 and A340592(50) = 255 mod 50 = 5, but 50 is not a palindromic prime.
		

Crossrefs

Programs

  • Maple
    revdigs:= proc(n) local L, i;
      L:= convert(n, base, 10);
      add(L[-i]*10^(i-1), i=1..nops(L))
    end proc:
    f:= proc(n) local L, p, i, r;
      L:= sort(map(t -> t[1]$t[2], ifactors(n)[2]));
      r:= L[1];
      for i from 2 to nops(L) do r:= r*10^(1+max(0, ilog10(L[i])))+L[i] od;
      r
    end proc:
    f(1):= 1:
    filter:= proc(n) local r;
    r:= revdigs(n);
    (f(n) - r) mod n = 0 and (revdigs(n) <> n or not isprime(n))
    end proc:
    select(filter, [$1..10^6]);
Showing 1-4 of 4 results.