A066341 Sum of distinct terms in n-th row of Fermat's triangle.
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
Offset: 2
Examples
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, ...
Links
- Antti Karttunen, Table of n, a(n) for n = 2..13737 (terms 2..2000 from Muniru A Asiru)
Programs
-
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
-
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} ]
-
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
Formula
Conjectures from Ridouane Oudra, Apr 05 2025: (Start)
a(n) = (n+1)*2^(omega(n)-1) - n, where omega(n) = A001221(n).
a(n) = (n+1)*A007875(n) - n.
Comments