cp's OEIS Frontend

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.

User: Conner L. Delahanty

Conner L. Delahanty's wiki page.

Conner L. Delahanty has authored 2 sequences.

A251364 Difference between average of two consecutive odd primes and the sum of all prime factors of the average.

Original entry on oeis.org

0, 1, 3, 5, 7, 10, 11, 11, 20, 15, 23, 30, 34, 38, 43, 48, 52, 43, 60, 53, 69, 41, 59, 82, 80, 90, 95, 71, 106, 83, 65, 110, 130, 135, 134, 145, 146, 146, 157, 165, 150, 177, 174, 179, 159, 179, 209, 202, 210, 173, 224, 200, 125, 238, 238, 254
Offset: 1

Author

Conner L. Delahanty, Mar 20 2015

Keywords

Comments

Sequence starts with the 2nd prime because the average of the first two primes is not an integer.

Examples

			For n = 1, the average of prime(2) and prime(3) is 4. The prime factors of 4 are 2 and 2. 4 - (2 + 2) = 0.
For n = 2, the average of prime(3) and prime(4) is 6. The prime factors of 6 are 2 and 3. 6 - (2 + 3) = 1.
For n = 3, the average of prime(4) and prime(5) is 9. The prime factors of 9 are 3 and 3. 9 - (3 + 3) = 3.
For n = 4, the average of prime(5) and prime(6) is 12. The prime factors of 12 are 2, 2, and 3. 12 - (2 + 2 + 3) = 5.
		

Crossrefs

Cf. A000040 (primes), A001414 (sopfr).

Programs

  • Mathematica
    f[{a_, b_}] := Table[a, {b}]; g[n_] := Block[{d = (Prime[n + 1] + Prime[n])/2}, d - Plus @@ Flatten[f /@ FactorInteger@ d]]; Table[g@ n, {n, 2, 57}] (* Michael De Vlieger, Mar 25 2015 *)

Formula

a(n) = ((prime(n+1) + prime(n+2))/2) - (sopfr((prime(n+1) + prime(n+2))/2)), where sopfr is A001414, the sum of primes dividing n (with repetition).

A233468 The digital root of prime(n+1) minus the digital root of prime(n).

Original entry on oeis.org

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

Author

Conner L. Delahanty, Apr 18 2014

Keywords

Examples

			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.
		

Crossrefs

Programs

  • 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 *)
  • 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

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