Displaying 1-10 of 486 results found.
page
1
2
3
4
5
6
7
8
9
10
... 49
Sum of squares of the decimal digits of the n-th prime.
+0
0
4, 9, 25, 49, 2, 10, 50, 82, 13, 85, 10, 58, 17, 25, 65, 34, 106, 37, 85, 50, 58, 130, 73, 145, 130, 2, 10, 50, 82, 11, 54, 11, 59, 91, 98, 27, 75, 46, 86, 59, 131, 66, 83, 91, 131, 163, 6, 17, 57, 89, 22, 94, 21, 30, 78, 49, 121, 54, 102, 69, 77, 94, 58, 11
EXAMPLE
For n=7, the 7th prime = 17 and those digits 1^2 + 7^2 = 50 = a(7).
MATHEMATICA
a[n_]:=Norm[IntegerDigits[Prime[n]]]^2; Array[a, 64] (* Stefano Spezia, Oct 03 2024 *)
PROG
(PARI) a(n) = norml2(digits(prime(n))); \\ Michel Marcus, Oct 03 2024
Indices where primes appear in A376198.
+0
0
2, 3, 9, 10, 11, 23, 24, 25, 26, 52, 53, 54, 55, 56, 57, 58, 59, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488
COMMENTS
The primes appear in order, so a(n) is also the index of prime(n) in A376198.
PROG
(Python)
from itertools import count, islice
from sympy import isprime, nextprime
def agen(): # generator of terms
an, smc, smp = 2, 4, 3
for n in count(2):
if not isprime(an):
an = smp if an == 2*smp else smc
else:
yield n
an = smp if smp < smc else smc
if an == smp: smp = nextprime(smp)
else:
smc += 1
while isprime(smc): smc += 1
1, 2, 3, 4, 9, 5, 10, 6, 7, 8, 11, 12, 23, 13, 14, 15, 24, 16, 25, 17, 18, 19, 26, 20, 21, 22, 27, 28, 52, 29, 53, 30, 31, 32, 33, 34, 54, 35, 36, 37, 55, 38, 56, 39, 40, 41, 57, 42, 43, 44, 45, 46, 58, 47, 48, 49, 50, 51, 59, 60, 110, 61, 62, 63, 64, 65, 111, 66, 67, 68, 112, 69, 113, 70, 71, 72, 73, 74, 114, 75, 76, 77, 115, 78, 79
PROG
(Python)
from itertools import count, islice
from sympy import isprime, nextprime
def agen(): # generator of terms
an, smc, smp, adict, n = 2, 4, 3, {1: 1, 2: 2}, 1
for k in count(3):
if not isprime(an):
an = smp if an == 2*smp else smc
else:
an = smp if smp < smc else smc
if an == smp: smp = nextprime(smp)
else:
smc += 1
while isprime(smc): smc += 1
if an not in adict: adict[an] = k
while n in adict: yield adict[n]; n += 1
a(1) = 1, a(2) = 2. Thereafter, let smc and smp denote the smallest missing composite and smallest missing prime. If a(n) is composite, then if a(n) = 2*smp then a(n+1) = smp, otherwise a(n+1) = smc; if a(n) is a prime, then if smp < smc, a(n+1) = smp, otherwise a(n+1) = smc.
+0
0
1, 2, 3, 4, 6, 8, 9, 10, 5, 7, 11, 12, 14, 15, 16, 18, 20, 21, 22, 24, 25, 26, 13, 17, 19, 23, 27, 28, 30, 32, 33, 34, 35, 36, 38, 39, 40, 42, 44, 45, 46, 48, 49, 50, 51, 52, 54, 55, 56, 57, 58, 29, 31, 37, 41, 43, 47, 53, 59, 60, 62, 63, 64, 65, 66, 68, 69, 70, 72, 74, 75, 76, 77, 78, 80, 81, 82, 84, 85, 86, 87, 88, 90, 91, 92, 93, 94
COMMENTS
The composite terms appear in their natural order, as do the primes.
This is a simplified version of A3765564 (the difference being in the way the composite numbers are handled: here they appear in order, whereas in A375564 successive composite numbers must have a common gcd greater than 1).
PROG
(Python)
from itertools import islice
from sympy import isprime, nextprime
def agen(): # generator of terms
an, smc, smp = 2, 4, 3
yield from [1, 2]
while True:
if not isprime(an):
an = smp if an == 2*smp else smc
else:
an = smp if smp < smc else smc
if an == smp: smp = nextprime(smp)
else:
smc += 1
while isprime(smc): smc += 1
yield an
CROSSREFS
See also A113646 (next composite number).
Semiprimes whose prime factors are the digit reversal of each other.
+0
0
4, 9, 25, 49, 121, 403, 1207, 2701, 7663, 10201, 17161, 22801, 32761, 35143, 36481, 75007, 97969, 117907, 124609, 127087, 139129, 140209, 146689, 173809, 197209, 247021, 257821, 342127, 382387, 528529, 573049, 619369, 635209, 643063, 692443, 743623, 844561, 863041
COMMENTS
The squares of all palindromic primes ( A002385) are a subsequence and these are the only perfect squares.
EXAMPLE
121 is a term because 121 = 11 * 11.
403 is a term because 403 = 13 * 31.
1207 is a term because 1207 = 17 * 71.
2701 is a term because 2701 = 37 * 73.
PROG
(PARI) upto(lim)={my(L=List()); forprime(p=2, sqrtint(lim), my(q=fromdigits(Vecrev(digits(p)))); if(isprime(q) && p*q<=lim, listput(L, p*q))); Set(L)}
Second differences of the Kolakoski sequence ( A000002). First differences of A054354.
+0
6
-1, -1, 1, 1, -2, 2, -1, -1, 2, -1, -1, 1, 1, -2, 1, 1, -1, -1, 2, -2, 1, 1, -2, 2, -1, -1, 1, 1, -2, 1, 1, -2, 2, -1, -1, 2, -1, -1, 1, 1, -2, 2, -1, -1, 2, -2, 1, 1, -2, 1, 1, -1, -1, 2, -1, -1, 1, 1, -2, 2, -1, -1, 2, -1, -1, 1, 1, -2, 1, 1, -2, 2, -1, -1
COMMENTS
Since A000002 has no runs of length 3, this sequence contains no zeros.
The densities appear to approach (1/3, 1/3, 1/6, 1/6).
EXAMPLE
The Kolakoski sequence ( A000002) is:
1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2, ...
1, 0, -1, 0, 1, -1, 1, 0, -1, 1, 0, -1, 0, 1, -1, 0, 1, 0, -1, 1, -1, 0, 1, -1, ...
-1, -1, 1, 1, -2, 2, -1, -1, 2, -1, -1, 1, 1, -2, 1, 1, -1, -1, 2, -2, 1, 1, -2, ...
MATHEMATICA
kolagrow[q_]:=If[Length[q]<2, Take[{1, 2}, Length[q]+1], Append[q, Switch[{q[[Length[Split[q]]]], q[[-2]], Last[q]}, {1, 1, 2}, 1, {1, 2, 1}, 2, {2, 1, 1}, 2, {2, 1, 2}, 2, {2, 2, 1}, 1, {2, 2, 2}, 1]]]
kol[n_]:=Nest[kolagrow, {1}, n-1];
Differences[kol[100], 2]
CROSSREFS
A078649 appears to be zeros of the first and third differences.
A288605 gives positions of first appearances of each balance.
A333254 lists run-lengths of differences between consecutive primes.
For the Kolakoski sequence ( A000002):
Length of n-th run of primes in A376198.
+0
0
2, 3, 4, 8, 13, 24, 43, 78, 142, 261, 479, 894, 1674
Indices n where a run of primes begins in A376198.
+0
0
2, 9, 23, 52, 110, 231, 472, 965, 1958, 3962, 7980, 16029, 32181
Indices n where a run of primes ends in A376198.
+0
0
3, 11, 26, 59, 122, 254, 514, 1042, 2099, 4222, 8458, 16922, 33854
Decimal expansion of Product_{p prime} (p^3 + 1)/(p^3 - 1).
+0
0
1, 4, 2, 0, 3, 0, 8, 3, 0, 3, 4, 8, 9, 1, 9, 3, 3, 5, 3, 2, 4, 8, 1, 8, 4, 4, 2, 7, 0, 6, 5, 4, 9, 0, 0, 6, 7, 5, 8, 6, 3, 9, 4, 6, 7, 1, 6, 3, 6, 8, 5, 6, 1, 8, 6, 8, 8, 2, 3, 5, 4, 3, 0, 6, 2, 1, 4, 2, 2, 9, 5, 4, 8, 4, 3, 6, 3, 4, 1, 7, 8, 3, 9, 2, 6, 4, 3, 1, 6, 8, 4, 0, 6, 1, 7, 3, 6, 4, 0, 5
FORMULA
Equals zeta(3)^2/zeta(6) = Sum_{k>=1} 2^omega(k)/k^3. See Shamos link.
Equals 945*zeta(3)^2/Pi^6.
EXAMPLE
1.420308303489193353248184427065490...
MATHEMATICA
RealDigits[Zeta[3]^2/Zeta[6], 10, 100][[1]]
PROG
(PARI) prodeulerrat((p^3 + 1)/(p^3 - 1))
Search completed in 0.166 seconds
|