[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A231475
Largest integer less than 5 and coprime to n.
3
4, 3, 4, 3, 4, 1, 4, 3, 4, 3, 4, 1, 4, 3, 4, 3, 4, 1, 4, 3, 4, 3, 4, 1, 4, 3, 4, 3, 4, 1, 4, 3, 4, 3, 4, 1, 4, 3, 4, 3, 4, 1, 4, 3, 4, 3, 4, 1, 4, 3, 4, 3, 4, 1, 4, 3, 4, 3, 4, 1, 4, 3, 4, 3, 4, 1, 4, 3, 4, 3, 4, 1, 4, 3, 4, 3, 4, 1, 4, 3, 4, 3, 4, 1, 4, 3, 4, 3, 4, 1, 4, 3, 4, 3, 4, 1, 4, 3, 4
OFFSET
1,1
LINKS
Wikipedia, GCD
FORMULA
a(2k+1) = 4 = 2*2.
a(2k) = 1 if 3|k, otherwise a(2k)=3. - Jon Perry, Nov 09 2013
EXAMPLE
a(1)=4 because this is the largest integer less than 5 and it's coprime to n=1.
a(2)=3 because 4 is not coprime to 2 but 3 is.
a(6)=1 because no other positive integer n<4 is coprime to 6=2*3.
MATHEMATICA
Max[Table[If[CoprimeQ[#, d], d, 0], {d, 4}]]&/@Range[100] (* Harvey P. Dale, Aug 27 2022 *)
PROG
(PARI) A231475(n, m=5) = for(k=1, m, gcd(n, m-k)==1&&return(m-k));
CROSSREFS
Cf. A231471 (analog for 11), A231470 (analog for 10), A231155.
Sequence in context: A367126 A136627 A108171 * A106055 A171783 A251767
KEYWORD
nonn,easy
AUTHOR
M. F. Hasler, Nov 09 2013
STATUS
approved