A130338 Primes p with no solution x to x=p*digitsum(x).
173, 383, 431, 443, 461, 491, 521, 563, 761, 821, 827, 839, 941, 971, 983, 1049, 1481, 1487, 1493, 1499, 1553, 1571, 1601, 1811, 1871, 1931, 2153, 2207, 2477, 2591, 2609, 2753, 3037, 3041, 3083, 3137, 3221, 3251, 3257, 3307, 3329, 3371
Offset: 1
Examples
p=5743 is not in the sequence because it can be represented as p=40201/7 (x=40201) or as p=80402/14 (x=80402). p=7 is not in the sequence because it can be represented as p=21/3 (x=21) or p=42/6 (x=42) or p=63/9 (x=63) or p=84/12 (x=84). In all cases, the denominators are the digit sums of the numerators.
Links
- David A. Corneth, Table of n, a(n) for n = 1..18497
Programs
-
Maple
A007953 := proc(n) option remember ; add(j,j=convert(n,base,10)) ; end: A001101 := proc(p) option remember : local k,digs ; digs := 1; if not isprime(p) then RETURN(-1) ; else while 10^(digs-1)/(9*digs) <= p do for k from max(p,10^(digs-1)) to 10^digs do if k = p*A007953(k) then RETURN(k) ; fi ; od ; digs := digs+1 ; od: RETURN(-1) ; fi ; end: for n from 1 to 500 do if A001101(ithprime(n)) = -1 then printf("%d,",ithprime(n)) ; fi : od: # R. J. Mathar, Aug 10 2007
-
Python
from itertools import count, islice, combinations_with_replacement from sympy import nextprime def A130338_gen(startvalue=1): # generator of terms >= startvalue n = nextprime(max(startvalue,1)-1) while True: for l in count(1): if 9*l*n < 10**(l-1): yield n break for d in combinations_with_replacement(range(10),l): if (s:=sum(d))>0 and sorted(str(s*n)) == [str(e) for e in d]: break else: continue break n = nextprime(n) A130338_list = list(islice(A130338_gen(),20)) # Chai Wah Wu, May 09 2023
Formula
Extensions
More terms from R. J. Mathar, Aug 10 2007
Comments