A250069 a(n) = n^2 mod gpf(n^2 + 1) where gpf(k) is the greatest prime dividing k.
1, 4, 4, 16, 12, 36, 4, 12, 40, 100, 60, 28, 16, 196, 112, 256, 28, 12, 180, 400, 16, 96, 52, 576, 312, 676, 72, 156, 420, 52, 36, 40, 108, 88, 612, 1296, 136, 16, 760, 1600, 28, 352, 36, 148, 1012, 72, 16, 460, 1200, 60, 1300, 540, 280, 2916, 88, 3136, 12
Offset: 1
Examples
a(5)=12 because 5^2 mod A014442(5) = 25 mod 13 = 12.
Links
- Michel Lagneau, Table of n, a(n) for n = 1..10000
Programs
-
Maple
with(numtheory): for n from 1 to 500 do: p:=n^2+1:x:=factorset(p):n0:=nops(x):r:=irem(n^2,x[n0]): printf(`%d, `, r): od:
-
Mathematica
Table[Mod[n^2,FactorInteger[n^2+1,FactorComplete->True][[-1,1]]],{n,100}]
-
PARI
a(n) = lift(Mod(n, vecmax(factor(n^2+1)[,1]))^2); \\ Michel Marcus, Sep 13 2017
Extensions
Edited: exchanged name with an old comment. Old name as an alternative formula. Keyword easy added. - Wolfdieter Lang, Nov 29 2014
Redundancy in Name and in Formula section removed (at the suggestion of Michel Marcus) by Jon E. Schoenfield, Sep 13 2017
Comments