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.

A340393 Treat the prime factors of n in ascending order as digits of a number in base "greatest prime factor + 1" and convert this number back to a decimal number.

This page as a plain text file.
%I A340393 #30 Jan 12 2021 19:10:46
%S A340393 2,3,8,5,11,7,26,15,17,11,43,13,23,23,80,17,47,19,89,31,35,23,171,35,
%T A340393 41,63,151,29,95,31,242,47,53,47,175,37,59,55,521,41,159,43,323,131,
%U A340393 71,47,683,63,107,71,433,53,191,71,1175,79,89,59,527,61,95,223,728
%N A340393 Treat the prime factors of n in ascending order as digits of a number in base "greatest prime factor + 1" and convert this number back to a decimal number.
%H A340393 Alois P. Heinz, <a href="/A340393/b340393.txt">Table of n, a(n) for n = 2..20000</a>
%F A340393 a(p) = p for prime p.
%e A340393 Some examples for the calculation of a(n):
%e A340393 (For digits 10,11...36 the letters A,B...Z are used.)
%e A340393     n -> prime factors     -> a(n)(base) -> a(n)(base 10)
%e A340393     6 -> 2 * 3             ->   23 (4)   ->   11
%e A340393    20 -> 2 * 2 * 5         ->  225 (6)   ->   89
%e A340393    33 -> 3 * 11            ->   3B (12)  ->   47
%e A340393    56 -> 2 * 2 * 2 * 7     -> 2227 (8)   -> 1175
%e A340393    62 -> 2 * 31            ->   2U (32)  ->   95
%e A340393    72 -> 2 * 2 * 2 * 3 * 3 ->22233 (4)   ->  687
%e A340393   100 -> 2 * 2 * 5 * 5     -> 2255 (6)   ->  539
%e A340393   910 -> 2 * 5 * 7 * 13    -> 257D (14)  -> 6579
%p A340393 a:= n-> (l-> (m-> add(l[-i]*m^(i-1), i=1..nops(l)))(1+
%p A340393     max(l)))(map(i-> i[1]$i[2], sort(ifactors(n)[2]))):
%p A340393 seq(a(n), n=2..77);  # _Alois P. Heinz_, Jan 09 2021
%o A340393 (Python)
%o A340393 def A(startn,lastn=0):
%o A340393     a,n,lastn=[],startn,max(lastn,startn)
%o A340393     while n<=lastn:
%o A340393         i,j,v,m,f=2,0,0,n,[]
%o A340393         while i<m**(0.5)+0.1:
%o A340393             if m//i==m/i:
%o A340393                 f.append(i)
%o A340393                 m,i=m//i,1
%o A340393             i+=1
%o A340393         f.append(m)
%o A340393         while j<len(f):v,j=v+f[j]*((f[len(f)-1]+1)**(len(f)-j-1)),j+1
%o A340393         print(str(n)+" "+str(v))
%o A340393         a.append([v])
%o A340393         n+=1
%o A340393     return a
%o A340393 (Python)
%o A340393 from sympy import factorint
%o A340393 def fromdigits(d, b):
%o A340393   n = 0
%o A340393   for di in d: n *= b; n += di
%o A340393   return n
%o A340393 def a(n):
%o A340393   f = sorted(factorint(n, multiple=True))
%o A340393   return fromdigits(f, f[-1]+1)
%o A340393 print([a(n) for n in range(2, 76)]) # _Michael S. Branicky_, Jan 06 2021
%o A340393 (PARI) a(n) = my(f=factor(n), list=List()); for (k=1, #f~, for (j=1, f[k, 2], listput(list, f[k,1]))); fromdigits(Vec(list), vecmax(f[,1])+1); \\ _Michel Marcus_, Jan 06 2021
%Y A340393 Cf. A037274 (home primes), A037276, A340394.
%K A340393 nonn,look,base
%O A340393 2,1
%A A340393 _S. Brunner_, Jan 06 2021