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.

A265640 Prime factorization palindromes (see comments for definition).

This page as a plain text file.
%I A265640 #71 Jan 30 2025 17:40:59
%S A265640 1,2,3,4,5,7,8,9,11,12,13,16,17,18,19,20,23,25,27,28,29,31,32,36,37,
%T A265640 41,43,44,45,47,48,49,50,52,53,59,61,63,64,67,68,71,72,73,75,76,79,80,
%U A265640 81,83,89,92,97,98,99,100,101,103,107,108,109,112,113,116,117,121,124,125,127,128,131,137,139,144
%N A265640 Prime factorization palindromes (see comments for definition).
%C A265640 a(66) is the first term at which this sequence differs from A119848.
%C A265640 A number N is called a prime factorization palindrome (PFP) if all its prime factors, taking into account their multiplicities, can be arranged in a row with central symmetry (see example). It is easy to see that every PFP-number is either a square or a product of a square and a prime. In particular, the sequence contains all primes.
%C A265640 Numbers which are both palindromes (A002113) and PFP are 1,2,3,4,5,7,9,11,44,99,101,... (see A265641).
%C A265640 If n is in the sequence, so is n^k for all k >= 0. - _Altug Alkan_, Dec 11 2015
%C A265640 The sequence contains all perfect numbers except 6 (cf. A000396). - _Don Reble_, Dec 12 2015
%C A265640 Equivalently, numbers that have at most one prime factor with odd multiplicity. - _Robert Israel_, Feb 03 2016
%C A265640 Numbers whose squarefree part is noncomposite. - _Peter Munn_, Jul 01 2020
%H A265640 Robert Israel, <a href="/A265640/b265640.txt">Table of n, a(n) for n = 1..10000</a>
%F A265640 lim A(x)/pi(x) = zeta(2) where A(x) is the number of a(n) <= x and pi is A000720.
%e A265640 44 is a member, since 44=2*11*2.
%e A265640 52 is a member, since 52=2*13*2. [This illustrates the fact that the digits don't need to form a palindrome. This is not a base-dependent sequence. - _N. J. A. Sloane_, Oct 05 2024]
%e A265640 180 is a member, since 180=2*3*5*3*2.
%p A265640 N:= 1000: # to get all terms <= N
%p A265640 P:= [1,op(select(isprime, [2,seq(i,i=3..N,2)]))]:
%p A265640 sort([seq(seq(p*x^2,x=1..floor(sqrt(N/p))),p=P)]); # _Robert Israel_, Feb 03 2016
%t A265640 M = 200; P = Join[{1}, Select[Join[{2}, Range[3, M, 2]], PrimeQ]]; Sort[ Flatten[Table[Table[p x^2, {x, 1, Floor[Sqrt[M/p]]}], {p, P}]]] (* _Jean-François Alcover_, Apr 09 2019, after _Robert Israel_ *)
%o A265640 (PARI) for(n=1, 200, if( ispseudoprime(core(n)) || issquare(n), print1(n, ", "))) \\ _Altug Alkan_, Dec 11 2015
%o A265640 (Python)
%o A265640 from math import isqrt
%o A265640 from sympy.ntheory.factor_ import core, isprime
%o A265640 def ok(n): return isqrt(n)**2 == n or isprime(core(n))
%o A265640 print([k for k in range(1, 145) if ok(k)]) # _Michael S. Branicky_, Oct 03 2024
%o A265640 (Python)
%o A265640 from math import isqrt
%o A265640 from sympy import primepi, mobius
%o A265640 def A265640(n):
%o A265640     def bisection(f,kmin=0,kmax=1):
%o A265640         while f(kmax) > kmax: kmax <<= 1
%o A265640         kmin = kmax >> 1
%o A265640         while kmax-kmin > 1:
%o A265640             kmid = kmax+kmin>>1
%o A265640             if f(kmid) <= kmid:
%o A265640                 kmax = kmid
%o A265640             else:
%o A265640                 kmin = kmid
%o A265640         return kmax
%o A265640     def f(x):
%o A265640         c = n-(a:=isqrt(x))
%o A265640         for y in range(1,a+1):
%o A265640             m = x//y**2
%o A265640             c -= primepi(m)-sum(mobius(k)*(m//k**2) for k in range(1, isqrt(m)+1))
%o A265640         return c
%o A265640     return bisection(f,n,n) # _Chai Wah Wu_, Jan 30 2025
%Y A265640 Cf. A000396, A000720, A002113, A265641, complement of A229153.
%Y A265640 Disjoint union of A229125 and (A000290\{0}).
%Y A265640 Cf. A013661 (zeta(2)).
%K A265640 nonn
%O A265640 1,2
%A A265640 _Vladimir Shevelev_, Dec 11 2015