login
A(n,k) is the n-th number m such that a nontrivial prime(k)-th root of unity modulo m exists; square array A(n,k), n>=1, k>=1, read by antidiagonals.
6

%I #29 Jun 10 2018 18:03:24

%S 8,7,12,11,9,15,29,22,13,16,23,43,25,14,20,53,46,49,31,18,21,103,79,

%T 67,58,33,19,24,191,137,106,69,71,41,21,28,47,229,206,131,89,86,44,26,

%U 30,59,94,361,239,157,92,87,50,27,32,311,118,139,382,274,158,115,98,55,28,33

%N A(n,k) is the n-th number m such that a nontrivial prime(k)-th root of unity modulo m exists; square array A(n,k), n>=1, k>=1, read by antidiagonals.

%C The trivial square roots of unity modulo m are {1, m-1} and for an odd prime p the trivial p-th root of unity modulo m is 1.

%C There is no prime in the first column.

%C Column k>1 contains prime(k)^2.

%H Alois P. Heinz, <a href="/A277915/b277915.txt">Antidiagonals n = 1..200, flattened</a>

%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Root_of_unity_modulo_n">Root of unity modulo n</a>

%e Square array A(n,k) begins:

%e : 8, 7, 11, 29, 23, 53, 103, 191, ...

%e : 12, 9, 22, 43, 46, 79, 137, 229, ...

%e : 15, 13, 25, 49, 67, 106, 206, 361, ...

%e : 16, 14, 31, 58, 69, 131, 239, 382, ...

%e : 20, 18, 33, 71, 89, 157, 274, 419, ...

%e : 21, 19, 41, 86, 92, 158, 289, 457, ...

%e : 24, 21, 44, 87, 115, 159, 307, 458, ...

%e : 28, 26, 50, 98, 121, 169, 309, 571, ...

%p with(numtheory):

%p A:= proc() local j, l; l:= proc() [] end;

%p proc(n, k)

%p while nops(l(k))<n do

%p for j from 1+`if`(l(k)=[], 0, l(k)[-1]) do

%p if k=1 and phi(j)> lambda(j) or k>1 and

%p irem(phi(j), ithprime(k))=0 then

%p l(k):= [l(k)[], j]; break fi

%p od

%p od: l(k)[n]

%p end

%p end():

%p seq(seq(A(n, 1+d-n), n=1..d), d=1..15);

%t A[n_, k_] := Module[{j, l = {}}, While[Length[l]<n, For[j = 1+If[l == {}, 0, l[[-1]]], True, j++, If[k==1 && EulerPhi[j]>CarmichaelLambda[j] || k>1 && Mod[EulerPhi[j], Prime[k]]==0, AppendTo[l, j]; Break[]]]]; l[[n]]];

%t Table[A[n, 1 + d - n], {d, 1, 15}, {n, 1, d}] // Flatten (* _Jean-François Alcover_, May 29 2018, from Maple *)

%Y Columns k=1-4 give: A033949, A066498, A066500, A066502.

%Y Row n=1 gives A066674 for k>1.

%Y Main diagonal gives A305828.

%Y Cf. A000010, A000040, A002322.

%K nonn,look,tabl

%O 1,1

%A _Alois P. Heinz_, Nov 03 2016