|
|
A066341
|
|
Sum of distinct terms in n-th row of Fermat's triangle.
|
|
1
|
|
|
1, 1, 1, 1, 8, 1, 1, 1, 12, 1, 14, 1, 16, 17, 1, 1, 20, 1, 22, 23, 24, 1, 26, 1, 28, 1, 30, 1, 94, 1, 1, 35, 36, 37, 38, 1, 40, 41, 42, 1, 130, 1, 46, 47, 48, 1, 50, 1, 52, 53, 54, 1, 56, 57, 58, 59, 60, 1, 184, 1, 64, 65, 1, 67, 202, 1, 70, 71, 214, 1, 74, 1, 76, 77, 78, 79, 238, 1
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
2,5
|
|
LINKS
|
|
|
EXAMPLE
|
Fermat's triangle (A066340) is {1}, {1, 1}, {1, 0, 1}, {1, 1, 1, 1}, {1, 4, 3, 4, 1}, ... and the distinct terms in each row are {1}, {1}, {0, 1}, {1}, {1, 3, 4}, ... with sums 1, 1, 1, 1, 8, ...
|
|
MATHEMATICA
|
Plus@@@(Union/@Table[ (PowerMod[ #, EulerPhi[ k ], k ])&/@ Range[ k-1 ], {k, 2, 256} ]) or equivalently Table[ w=Length[ FactorInteger[ k ]]; (2^(w-1)-1)*k+2^(w-1), {k, 2, 256} ]
|
|
PROG
|
(PARI) A066341(n) = { my(ph = eulerphi(n), m=Map(), t, s=0); for(k=1, n-1, t = ((k^ph)%n); if(!mapisdefined(m, t), s += t; mapput(m, t, t))); (s); }; \\ Antti Karttunen, Aug 06 2018
(GAP) List(List(List([2..80], n->List([1..n-1], m->PowerMod(m, Phi(n), n))), Set), Sum); # Muniru A Asiru, Aug 06 2018
|
|
CROSSREFS
|
|
|
KEYWORD
|
easy,nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|