A073903 Duplicate of A069710.
11, 1021, 1201, 2011, 3001, 10103, 10211, 10301, 11003, 12011, 12101, 13001, 20021, 20201, 21011, 21101
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.
Do[ If[ IntegerQ[ Apply[ Plus, IntegerDigits[n^2]] / Floor[ Log[10, n^2] + 1]], Print[n^2]], {n, 1, 10^3}]
Do[p = Prime[n]; If[ IntegerQ[ Apply[ Plus, IntegerDigits[p]] / Floor[ Log[10, p] + 1]], Print[p]], {n, 1, 10^3}] Select[Prime[Range[400]],IntegerQ[Mean[IntegerDigits[#]]]&] (* Harvey P. Dale, Jan 29 2012 *)
[n: n in [1..100000] | IsPrime(n) and &+Intseq(n) mod #Intseq(n) eq 0 and &+Intseq(n) / #Intseq(n) eq 2];
S:= proc(d,k,flag) option remember; if d = 1 then if k >= 0 and k <= 9 then return [k] else return [] fi fi; [seq(op(map(`+`, procname(d-1,k-i,0), i*10^(d-1))),i=flag..min(k,9))] end proc: seq(op(select(isprime,S(d,2*d,1))),d=1..5);# Robert Israel, Apr 23 2017
Select[Prime[Range[1600]],Mean[IntegerDigits[#]]==2&] (* Harvey P. Dale, Aug 07 2021 *)
[n: n in [1..100000] | IsPrime(n) and &+Intseq(n) mod #Intseq(n) eq 0 and &+Intseq(n) / #Intseq(n) eq 4];
Select[Prime[Range[600]],Mean[IntegerDigits[#]]==4&] (* Harvey P. Dale, Jun 11 2024 *)
[n: n in [1..100000] | IsPrime(n) and &+Intseq(n) mod #Intseq(n) eq 0 and &+Intseq(n) / #Intseq(n) eq 5];
Select[Prime@ Range@ PrimePi@ 5000, Mean@ IntegerDigits@ # == 5 &] (* Michael De Vlieger, Apr 22 2017 *)
[n: n in [1..100000] | IsPrime(n) and &+Intseq(n) mod #Intseq(n) eq 0 and &+Intseq(n) / #Intseq(n) eq 7]
Select[Prime@ Range@ PrimePi@ 40000, Mean@ IntegerDigits@ # == 7 &] (* Michael De Vlieger, Apr 22 2017 *)
from itertools import count, islice from collections import Counter from sympy.utilities.iterables import partitions, multiset_permutations from sympy import isprime def A285227_gen(): # generator of terms yield 7 for l in count(2): for i in range(1,10): yield from sorted(q for q in (int(str(i)+''.join(map(str,j))) for s,p in partitions(7*l-i,m=l-1,k=9,size=True) for j in multiset_permutations([0]*(l-1-s)+list(Counter(p).elements()))) if isprime(q)) A285227_list = list(islice(A285227_gen(),30)) # Chai Wah Wu, Nov 29 2023
[n: n in [1..100000] | IsPrime(n) and &+Intseq(n) mod #Intseq(n) eq 0 and &+Intseq(n) / #Intseq(n) eq 8];
Select[Prime@ Range@ PrimePi[10^5], Mean@ IntegerDigits@ # == 8 &] (* Michael De Vlieger, Apr 22 2017 *)
from itertools import count, islice from collections import Counter from sympy.utilities.iterables import partitions, multiset_permutations def A285228_gen(): # generator of terms for l in count(2): for i in range(1,10): yield from sorted(q for q in (int(str(i)+''.join(map(str,j))) for s,p in partitions((l<<3)-i,m=l-1,k=9,size=True) for j in multiset_permutations([0]*(l-1-s)+list(Counter(p).elements()))) if isprime(q)) A285228_list = list(islice(A285228_gen(),30)) # Chai Wah Wu, Nov 28 2023
Do[ If[ IntegerQ[ Apply[ Plus, IntegerDigits[n(n + 1)/2]] / Floor[ Log[10, n(n + 1)/2] + 1]], Print[n(n + 1)/2]], {n, 1, 10^3}] Select[Accumulate[Range[200]],IntegerQ[Mean[IntegerDigits[#]]]&] (* Harvey P. Dale, Jun 17 2017 *)
a(2) = 102001 is in the sequence because 1^2+0^2+2^2+0^2+0^2+1^2 = 6 = length(a(2)).
g:= proc(n,s) option remember; # <= n-digit numbers with sum of squares of digits = s option remember; local j; if s = 0 then return [0] elif n = 0 then return [] fi; [seq(op(map(t -> 10*t + j, procname(n-1, s-j^2))),j=0 .. min(9,floor(sqrt(s))))] end proc: sort([seq(op(select(t -> t >= 10^(n-1) and isprime(t), g(n,n))),n=1..9)]); # Robert Israel, Jan 09 2025
fQ[n_] := Plus @@ (IntegerDigits[n]^2) == IntegerLength[n]; Select[Prime[Range[100000000]], fQ] (* Robert G. Wilson v, Nov 07 2011 *)
Comments