login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A170821 Let p = n-th prime; a(n) = smallest k >= 0 such that 4k == 3 mod p. 3
0, 2, 6, 9, 4, 5, 15, 18, 8, 24, 10, 11, 33, 36, 14, 45, 16, 51, 54, 19, 60, 63, 23, 25, 26, 78, 81, 28, 29, 96, 99, 35, 105, 38, 114, 40, 123, 126, 44, 135, 46, 144, 49, 50, 150, 159, 168, 171, 58, 59, 180, 61, 189, 65, 198, 68, 204, 70, 71, 213, 74, 231, 234, 79, 80, 249, 85, 261 (list; graph; refs; listen; history; text; internal format)
OFFSET

2,2

LINKS

Robert Israel, Table of n, a(n) for n = 2..10000

I. Anderson and D. A. Preece, Combinatorially fruitful properties of 3*2^(-1) and 3*2^(-2) modulo p, Discr. Math., 310 (2010), 312-324.

FORMULA

a(n) = (prime(n)+3)/4 if n is in A080147, (3*prime(n)+3)/4 if n is in A080148 (except for n=2). - Robert Israel, Dec 03 2018

MAPLE

f:=proc(n) local b; for b from 0 to n-1 do if 4*b mod n = 3 then RETURN(b); fi; od: -1; end; [seq(f(ithprime(n)), n=2..100)]; # Gives wrong answer for n=2.

# Alternative:

f:= n -> 3/4 mod ithprime(n):

map(f, [$2..100]); # Robert Israel, Dec 03 2018

MATHEMATICA

a[n_] := If[n<3, 0, Module[{p=Prime[n], k=0}, While[Mod[4k, p] != 3, k++]; k]]; Array[a, 100, 2] (* Amiram Eldar, Dec 03 2018 *)

PROG

(PARI) a(n) = my(p=prime(n), k=0); while(Mod(4*k, p) != 3, k++); k; \\ Michel Marcus, Dec 03 2018

CROSSREFS

Cf. A000040, A080147, A080148.

Sequence in context: A104752 A343745 A183000 * A096667 A265989 A225847

Adjacent sequences:  A170818 A170819 A170820 * A170822 A170823 A170824

KEYWORD

nonn,look

AUTHOR

N. J. A. Sloane, Dec 24 2009

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 5 23:41 EDT 2021. Contains 343579 sequences. (Running on oeis4.)