A351741 Numbers k such that the concatenation of 1,2,...,k and the concatenation of k,k-1,...,1 have the same number of prime factors, counted with multiplicity.
1, 3, 4, 5, 7, 10, 13, 16, 23, 26, 31, 32, 37, 39, 51, 54, 56
Offset: 1
Examples
a(3) = 4 is a term because 1234 = 2*617 and 4321 = 29*149 each have two prime factors.
Programs
-
Maple
dcat:= (a,b) -> a*10(1+ilog10(b))+b: a:= 1: b:= 1: R:= 1: for n from 2 to 40 do a:= dcat(n,a); b:= dcat(b,n); if numtheory:-bigomega(a) = numtheory:-bigomega(b) then R:= R,n fi od: R;
-
Mathematica
Select[Range[32], SameQ @@ PrimeOmega@{FromDigits@ Flatten@ #, FromDigits@ Flatten@ Reverse[#]} &@ IntegerDigits@ Range[#] &] (* Michael De Vlieger, Feb 17 2022 *)
-
Python
from sympy import primeomega def afind(limit, startk=1): k = startk sk = "".join(str(i) for i in range(1, k)) skr = "".join(str(i) for i in range(k-1, 0, -1)) for k in range(startk, limit+1): sk += str(k) skr = str(k) + skr if primeomega(int(sk)) == primeomega(int(skr)): print(k, end=", ") afind(23) # Michael S. Branicky, Feb 17 2022
Extensions
a(17) from Michael S. Branicky, Feb 19 2022
Comments