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!)
A338467 a(n+1) = prime(n) + 2*n - a(n). a(1) = 1. 0
1, 3, 4, 7, 8, 13, 12, 19, 16, 25, 24, 29, 32, 35, 36, 41, 44, 49, 48, 57, 54, 61, 62, 67, 70, 77, 76, 81, 82, 85, 88, 101, 94, 109, 98, 121, 102, 129, 110, 135, 118, 143, 122, 155, 126, 161, 130, 175, 144, 181, 148, 187, 156, 191, 168, 199, 176, 207, 180, 215 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
FORMULA
a(n+1) = A078916(n) - a(n). - Michel Marcus, Jan 31 2021
EXAMPLE
a(1) + a(2) - 2*1 = 1st prime; 1 + 3 - 2*1 = 2.
a(13) + a(14) - 2*13 = 13th prime; 32 + 35 - 2*13 = 41.
MAPLE
a:= proc(n) option remember; `if`(n=1, 1,
ithprime(n-1)-a(n-1)+2*n-2)
end:
seq(a(n), n=1..60); # Alois P. Heinz, Jan 31 2021
MATHEMATICA
a[1] = 1; a[n_] := a[n] = Prime[n - 1] + 2*(n - 1) - a[n - 1]; Array[a, 60] (* Amiram Eldar, Feb 01 2021 *)
PROG
(Python)
from sympy import prime
S=[1]
nomb=100
for n in range(1, nomb):
derterm=S[-1]
terme= prime(n)-derterm+2*(len(S))
S.append(terme)
print(S)
(PARI) a(n) = if (n==1, 1, prime(n-1) + 2*(n-1) - a(n-1)); \\ Michel Marcus, Jan 31 2021
CROSSREFS
Sequence in context: A025032 A207524 A003141 * A284491 A284506 A157419
KEYWORD
nonn,easy
AUTHOR
Carole Dubois, Jan 31 2021
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 April 25 01:35 EDT 2024. Contains 371964 sequences. (Running on oeis4.)