OFFSET
2,3
COMMENTS
LINKS
Alois P. Heinz, Rows n = 2..2000 of irregular triangle, flattened
EXAMPLE
The table starts out as follows:
1
1 2
1 3
1 4
1 5
1 6
1 3 5 7
1 8
1 9
1 10
1 5 7 11
...
MAPLE
T:= n-> seq(`if`(k&^2 mod n=1, k, NULL), k=1..n-1):
seq(T(n), n=2..50); # Alois P. Heinz, Aug 20 2013
MATHEMATICA
Flatten[Table[Position[Mod[Range[n]^2, n], 1], {n, 2, 50}]] (* T. D. Noe, Aug 20 2013 *)
PROG
(Sage) [[i for i in [1..k-1] if (i*i).mod(k)==1] for k in [2..n]] #changing n gives you the table up to the n-th row.
(Python)
from itertools import chain, count, islice
from sympy.ntheory import sqrt_mod_iter
def A228179_gen(): # generator of terms
return chain.from_iterable((sorted(sqrt_mod_iter(1, n)) for n in count(2)))
CROSSREFS
KEYWORD
nonn,easy,tabf
AUTHOR
Tom Edgar, Aug 20 2013
STATUS
approved