login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A233468
The digital root of prime(n+1) minus the digital root of prime(n).
1
1, 2, 2, -5, 2, 4, -7, 4, -3, 2, -3, 4, 2, -5, 6, -3, 2, -3, 4, -7, 6, -5, 6, -1, -5, 2, 4, -7, 4, -4, 4, -3, 2, 1, 2, -3, -3, 4, -3, 6, -7, 1, 2, 4, -7, 3, 3, -5, 2, 4, -3, 2, 1, -3, -3, 6, -7, 6, -5, 2, 1, -4, 4, 2, -5, 5, -3, 1, 2, -5, 6
OFFSET
1,2
LINKS
FORMULA
a(n) = (prime(n+1) mod 9) - (prime(n) mod 9).
a(n) = prime(n + 1) - 9*floor((prime(n + 1) - 1)/9) - prime(n) + 9*floor((prime(n) - 1)/9). - Wesley Ivan Hurt, Apr 19 2014
a(n) = A010888(A000040(n+1)) - A010888(A000040(n)). - Michel Marcus, Apr 19 2014
EXAMPLE
For n = 1, (prime(2) mod 9) - (prime(1) mod 9) = 3 (mod 9) - 2 (mod 9) = 3-2 = 1.
For n = 2, (prime(3) mod 9) - (prime(2) mod 9) = 5 (mod 9) - 3 (mod 9) = 5-3 = 2.
For n = 3, (prime(4) mod 9) - (prime(3) mod 9) = 7 (mod 9) - 5 (mod 9) = 7-5 = 2.
For n = 4, (prime(5) mod 9) - (prime(4) mod 9) = 11 (mod 9) - 7 (mod 9) = 2-7 = -5.
MAPLE
A233468:=n->(ithprime(n+1) mod 9) - (ithprime(n) mod 9); seq(A233468(n), n=1..100); # Wesley Ivan Hurt, Apr 19 2014
MATHEMATICA
Table[Mod[Prime[n + 1], 9] - Mod[Prime[n], 9], {n, 100}] (* Wesley Ivan Hurt, Apr 19 2014 *)
PROG
(Python)
dd=[]
def prim(end):
....num=3
....primes=[2, 3]
....while (len(primes)<=end):
........num+=1
........prime=False
........length=len(primes)
........for y in range(0, length):
............if (num % primes[y]!=0):
................prime=True
............else:
................prime=False
................break
........if (prime):
............primes.append(num)
....for x in range(len(primes)-1):
........dd.append((primes[x+1]%9) - (primes[x]%9))
....return dd
CROSSREFS
Sequence in context: A004543 A153078 A245565 * A076200 A039931 A128645
KEYWORD
base,sign,easy
AUTHOR
Conner L. Delahanty, Apr 18 2014
STATUS
approved