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!)
A345366 a(n) = (p*q+1) mod (p+q) where p=prime(n) and q=prime(n+1). 0
2, 0, 0, 6, 0, 12, 0, 18, 44, 0, 60, 36, 0, 42, 92, 104, 0, 120, 66, 0, 144, 78, 164, 78, 96, 0, 102, 0, 108, 192, 126, 260, 0, 264, 0, 300, 312, 162, 332, 344, 0, 348, 0, 192, 0, 170, 182, 222, 0, 228, 464, 0, 468, 500, 512, 524, 0, 540, 276, 0, 552, 552, 306 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
The graph of this function consists of three branches: the upper one corresponds to cases where q-p == 2 (mod 4) except the twin primes, the middle one to cases where q-p == 0 (mod 4), and the lower one (where a(n)=0) to cases where q-p = 2, the twin primes.
All terms are even.
LINKS
FORMULA
a(n) = A023523(n+1) mod A001043(n). - Michel Marcus, Jun 17 2021
EXAMPLE
a(1) = ( 2* 3+1) mod ( 2+ 3) = 7 mod 5 = 2,
a(2) = ( 3* 5+1) mod ( 3+ 5) = 16 mod 8 = 0,
a(3) = ( 5* 7+1) mod ( 5+ 7) = 36 mod 12 = 0,
a(4) = ( 7*11+1) mod ( 7+11) = 78 mod 18 = 6,
a(5) = (11*13+1) mod (11+13) = 144 mod 24 = 0.
MAPLE
a:= n-> ((p, q)-> irem(p*q+1, p+q))(map(ithprime, [n, n+1])[]):
seq(a(n), n=1..63); # Alois P. Heinz, Jul 03 2021
MATHEMATICA
Mod[#1*#2 + 1, #1 + #2] & @@@ Partition[Select[Range[300], PrimeQ], 2, 1] (* Amiram Eldar, Jun 16 2021 *)
PROG
(PARI) a(n)=my(p=prime(n), q=nextprime(p+1)); (p*q+1)%(p+q)
(Ruby) require 'prime'
values = []
Prime.first(21).each_cons(2) do |a, b|
values << (a * b + 1) % (a + b)
end
p values
(Python)
from sympy import nextprime
def aupton(nn):
alst, p, q = [], 2, 3
while len(alst) < nn: alst.append((p*q+1)%(p+q)); p, q = q, nextprime(q)
return alst
print(aupton(62)) # Michael S. Branicky, Jun 16 2021
CROSSREFS
Cf. A000040, A212769, A029707 (indices of 0's).
Sequence in context: A344441 A221728 A339942 * A278720 A221524 A193009
KEYWORD
nonn
AUTHOR
Simon Strandgaard, Jun 16 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 19 12:14 EDT 2024. Contains 371792 sequences. (Running on oeis4.)