A084994 Duplicate of A046328.
4, 6, 9, 22, 33, 55, 77, 111, 121, 141, 161, 202, 262, 303, 323, 393, 454, 505, 515, 535
Offset: 1
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.
26 is a semiprime, as it is 2 * 13, and so is 62 = 2 * 31. 26 and 62 are therefore both in the sequence.
isA097393 := proc(n) local R ; R := digrev(n) ; if R <> n then if numtheory[bigomega](R) = 2 and numtheory[bigomega](n) = 2 then return true; else false; end if; else false; end if; end proc: for n from 1 to 500 do if isA097393(n) then printf("%d,",n) ; end if; end do: # R. J. Mathar, Apr 05 2012
Cases[{#, IntegerReverse@#} & /@ DeleteCases[Range@5000, ?PalindromeQ], {?(PrimeOmega@# == 2 &) ..}][[All,1]] (* Hans Rudolf Widmer, Jan 07 2024 *)
rev(n)=subst(Polrev(digits(n)),'x,10) issemi(n)=bigomega(n)==2 list(lim)=my(v=List(),r);forprime(p=2,lim\2,forprime(q=2,min(lim\p,p),r=rev(p*q);if(issemi(r)&&r!=p*q,listput(v,p*q))));Set(v) \\ Charles R Greathouse IV, Jan 27 2015
from sympy import factorint from itertools import islice def sp(n): f = factorint(n); return sum(f[p] for p in f) == 2 def ok(n): r = int(str(n)[::-1]); return r != n and sp(n) and sp(r) print([k for k in range(534) if ok(k)]) # Michael S. Branicky, Jul 03 2022
The palindrome 35653 is a term since it has 2 factors, 101 and 353, both palindromic.
Take[Select[Times@@@Tuples[Select[Prime[Range[5000]],PalindromeQ],2], PalindromeQ]// Union,50] (* Harvey P. Dale, Aug 25 2019 *)
{first(N=50, p=1) = vector(N, i, until( bigomega( p=nxt_A002113(p))==2 && vecmin( apply( is_A002113, factor(p)[,1])),); p)} \\ M. F. Hasler, Jan 04 2022
from sympy import factorint from itertools import product def ispal(n): s = str(n); return s == s[::-1] def pals(d, base=10): # all d-digit palindromes digits = "".join(str(i) for i in range(base)) for p in product(digits, repeat=d//2): if d > 1 and p[0] == "0": continue left = "".join(p); right = left[::-1] for mid in [[""], digits][d%2]: yield int(left + mid + right) def ok(pal): f = factorint(pal) return sum(f.values()) == 2 and all(ispal(p) for p in f) print(list(filter(ok, (p for d in range(1, 6) for p in pals(d) if ok(p))))) # Michael S. Branicky, Aug 14 2022
Select[Range[65000],PalindromeQ[#]&&Total[Boole[PalindromeQ/@ FactorInteger[ #][[All,1]]]]==2&&PrimeOmega[#]==2&] (* Harvey P. Dale, Aug 07 2021 *)
ispal(n) = my(d=digits(n)); d == Vecrev(d) \\ A002113 for(k=1, 1e5, if(ispal(k)&&bigomega(k)==2,a=divisors(k); if(#a==4&&ispal(a[2])&&ispal(a[3]), print1(k,", ")))) \\ Alexandru Petrescu, Aug 14 2022
from sympy import factorint from itertools import product def ispal(n): s = str(n); return s == s[::-1] def pals(d, base=10): # all d-digit palindromes digits = "".join(str(i) for i in range(base)) for p in product(digits, repeat=d//2): if d > 1 and p[0] == "0": continue left = "".join(p); right = left[::-1] for mid in [[""], digits][d%2]: yield int(left + mid + right) def ok(pal): f = factorint(pal) return len(f) == 2 and sum(f.values()) == 2 and all(ispal(p) for p in f) print(list(filter(ok, (p for d in range(1, 6) for p in pals(d) if ok(p))))) # Michael S. Branicky, Jun 22 2021
a(12) = 11111111111 = 21649 * 513239 is semiprime.
with(numtheory):for n from 1 to 23 do:for b from 1 to 9 do:x:=(((10^n)- 1)/9)*b:if bigomega(x)=2 then printf(`%d, `,x):else fi:od:od:
Select[FromDigits/@Flatten[Table[PadRight[{},i,n],{i,25},{n,9}],1], PrimeOmega[ #] ==2&] (* Harvey P. Dale, Mar 11 2019 *)
print1("4, 6, 9");for(n=1,20,t=10^n\9;if(bigomega(t)==2,print1(", "t)); if(isprime(t),forprime(p=2,7,print1(", "p*t)))) \\ Charles R Greathouse IV, Oct 27 2011
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 F; F:= ifactors(n)[2]; if nops(F) = 2 and F[1,2]=1 and F[2,2]=1 then n fi end proc: N:=5: # for terms of up to N digits. Res:= 6: for d from 2 to N do if d::even then m:= d/2; Res:= Res, seq(f(n*10^m + revdigs(n)), n=10^(m-1)..10^m-1); else m:= (d-1)/2; Res:= Res, seq(seq(f(n*10^(m+1)+y*10^m+revdigs(n)), y=0..9), n=10^(m-1)..10^m-1); fi od: Res; # Robert Israel, Mar 24 2020
pdpfQ[n_]:=Module[{idn=IntegerDigits[n]},idn==Reverse[idn] && PrimeNu[n] == PrimeOmega[n] == 2]; Select[Range[11000],pdpfQ] (* Harvey P. Dale, Dec 16 2012 *)
from sympy import factorint from itertools import product def pals(d, base=10): # all d-digit palindromes digits = "".join(str(i) for i in range(base)) for p in product(digits, repeat=d//2): if d > 1 and p[0] == "0": continue left = "".join(p); right = left[::-1] for mid in [[""], digits][d%2]: yield int(left + mid + right) def ok(pal): f = factorint(pal); return len(f) == 2 and sum(f.values()) == 2 print(list(filter(ok, (p for d in range(1, 5) for p in pals(d) if ok(p))))) # Michael S. Branicky, Jun 22 2021
t = Select[Range[200], PrimeOmega[#] == 2 &]; FromDigits[Reverse[IntegerDigits[#]]] & /@ t (* T. D. Noe, Mar 26 2012 *) IntegerReverse/@Select[Range[500],PrimeOmega[#]==2&] (* Harvey P. Dale, Dec 06 2021 *)
Number of divisors of palindrome number 22 with divisors 1, 2, 11 and 22 is 4 (palindrome number).
[n: n in [1..1000] | Intseq(n, 10) eq Reverse(Intseq(n, 10)) and Intseq(NumberOfDivisors(n), 10) eq Reverse(Intseq(NumberOfDivisors(n), 10))]
ispali:= proc(n) local L; L:= convert(n,base,10); L = ListTools:-Reverse(L) end proc: select(t -> ispali(t) and ispali(numtheory:-tau(t)), [$1..10000]); # Robert Israel, Mar 26 2019
Select[Range@ 600, And[PalindromeQ@ #, PalindromeQ@ DivisorSigma[0, #]] &] (* Michael De Vlieger, Mar 24 2019 *)
ispal(n) = my(d=digits(n)); Vecrev(d) == d; isok(n) = ispal(n) && ispal(numdiv(n)); \\ Michel Marcus, Mar 23 2019
9=3^2, 33=3*11 and 55=5*11 are palindromic, odd and are products of exactly 2 prime factors.
test := proc(n) local d; d := convert(n,base,10); return ListTools[Reverse](d)=d and numtheory[bigomega](n)=2; end; a := []; for n from 1 to 14000 by 2 do if test(n) then a := [op(a),n]; end; od; a;
NextPalindrome[n_] := Block[ {l = Floor[ Log[10, n] + 1], idn = IntegerDigits[n]}, If[ Union[ idn] == {9}, Return[n + 2], If[l < 2, Return[n + 1], If[ FromDigits[ Reverse[ Take[ idn, Ceiling[l/2]]]] > FromDigits[ Take[ idn, -Ceiling[l/2]]], FromDigits[ Join[ Take[ idn, Ceiling[l/2]], Reverse[ Take[ idn, Floor[l/2]]] ]], idfhn = FromDigits[ Take[ idn, Ceiling[l/2]]] + 1; idp = FromDigits[ Join[ IntegerDigits[ idfhn], Drop[ Reverse[ IntegerDigits[ idfhn]], Mod[l, 2]]]] ]]]]; fQ[n_] := Plus @@ Last /@ FactorInteger[n] == 2; c = np = 0; Do[ While[np < 10^n, If[ fQ[np], c++ ]; np = NextPalindrome[np]]; Print[c], {n, 0, 12}]
Comments