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.

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);

A340592 a(n) is the concatenation of the prime factors (with multiplicity) of n mod n.

Original entry on oeis.org

0, 0, 2, 0, 5, 0, 6, 6, 5, 0, 7, 0, 13, 5, 14, 0, 17, 0, 5, 16, 13, 0, 15, 5, 5, 9, 3, 0, 25, 0, 14, 14, 13, 22, 1, 0, 29, 1, 25, 0, 27, 0, 11, 20, 39, 0, 47, 28, 5, 11, 29, 0, 11, 16, 43, 34, 55, 0, 15, 0, 45, 22, 14, 58, 1, 0, 41, 47, 47, 0, 57, 0, 15, 55, 15, 18, 51, 0, 65, 12, 77, 0, 53, 7
Offset: 2

Views

Author

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

Keywords

Comments

a(n) = 0 if n is prime.
The first composite n for which a(n)=0 is 28749. Are there others?
There are no other composite n terms for which a(n)=0 up to 5 million. - Harvey P. Dale, Jul 17 2023

Examples

			For n = 20 = 2*2*5, a(20) = 225 mod 20 = 5.
		

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:
    map(f, [$2..100]);
  • Mathematica
    Table[Mod[FromDigits[Flatten[IntegerDigits/@Table[#[[1]],#[[2]]]&/@FactorInteger[n]]],n],{n,2,100}] (* Harvey P. Dale, Jul 17 2023 *)
  • Python
    from sympy import factorint
    def a(n):
        if n == 1: return 0
        return int("".join(str(f) for f in factorint(n, multiple=True)))%n
    print([a(n) for n in range(2, 86)]) # Michael S. Branicky, Jan 18 2022

Formula

a(n) = A037276(n) mod n.
Showing 1-2 of 2 results.