login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A270536 a(1) = 0; a(n) is the sum of m < n for which a(m) + n is not prime. 2
0, 0, 0, 6, 0, 15, 6, 22, 28, 45, 33, 66, 35, 64, 74, 104, 102, 140, 129, 160, 182, 196, 170, 263, 241, 285, 257, 281, 319, 329, 372, 423, 414, 460, 491, 537, 520, 582, 623, 647, 724, 836, 731, 772, 817, 947, 887, 1062, 879, 834, 1076 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,4

LINKS

Peter Kagey, Table of n, a(n) for n = 1..1000

EXAMPLE

a(1) = 0.

a(2) = 0 because 2 + a(1) is prime.

a(3) = 0 because 3 + a(i) is prime for 1 <= i <= 2.

a(4) = 6 because 4 + a(1), 4 + a(2), and 4 + a(3) are nonprime; 1 + 2 + 3 = 6.

a(5) = 0 because 5 + a(i) is prime for 1 <= i <= 4.

PROG

(Java)

public static int[] sequenceD(int n) {

    int[] terms = new int[n];

    terms[0] = 0;

    terms[1] = 0;

    for (int i = 2; i < n; i++) {

        int count = 0;

        for (int j = 1; j < i; j++) {

            if (!prime(terms[j] + i)) {

                count = count + j;

            }

        }

        terms[i] = count;

    }

    return terms;

}

(PARI) lista(nn) = {va = vector(nn); print1(va[1], ", "); for (n=2, nn, va[n] = sum(k=1, n-1, k*(! isprime(n+va[k]))); print1(va[n], ", "); ); } \\ Michel Marcus, Mar 28 2016

CROSSREFS

Cf. A270654, which is the sum of m < n for which a(m) + n is prime.

Sequence in context: A175567 A069828 A340951 * A278712 A057401 A308236

Adjacent sequences:  A270533 A270534 A270535 * A270537 A270538 A270539

KEYWORD

easy,nonn

AUTHOR

Alec Jones, Mar 28 2016

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 8 21:55 EDT 2022. Contains 356016 sequences. (Running on oeis4.)