editing
proposed
editing
proposed
F[n_] := MatrixPower[{{0, 1}, {1, 1}}, n][[1, 2]];
p[M_, n_, k_] := Mod[#, k]& /@ If[n == 0, {{1, 0}, {0, 1}}, If[EvenQ[n], MatrixPower[p[M, n/2, k], 2], p[M, n - 1, k].M]];
a[n_] := p[{{0, 1}, {1, 1}}, F[n], n][[1, 2]];
Table[a[n], {n, 1, 80}] (* Jean-François Alcover, Oct 29 2024, after Alois P. Heinz *)
approved
editing
editing
proposed
F[n_] := MatrixPower[{{0, 1}, {1, 1}}, n][[1, 2]];
p[M_, n_, k_] := Mod[#, k]& /@ If[n == 0, {{1, 0}, {0, 1}}, If[EvenQ[n], MatrixPower[p[M, n/2, k], 2], p[M, n - 1, k].M]];
a[n_] := p[{{0, 1}, {1, 1}}, F[n], F[n]][[1, 2]];
Table[a[n], {n, 1, 50}] (* Jean-François Alcover, Oct 29 2024, after Alois P. Heinz *)
approved
editing
editing
proposed
(* This partly empirical program is just a recomputation of existing data. *)
f[n_, k_] := Module[{c, cc, dd}, dd = Most@ Divisors@k; cc = c[#]& /@ Range@ Length@dd; FindInstance[AllTrue[cc, 0 <= # <= 1&] && cc.dd == k && Total[cc] == n, cc, Integers, 1]];
a[n_] := a[n] = Switch[n, 1, 1, 2, 0, 3, 6, _, For[k = a[n - 1], True, k = k + If[n < 25, 1, 60], If[f[n, k] != {}, Return[k]]]];
Table[Print[n, " ", a[n]]; a[n], {n, 1, 49}] (* Jean-François Alcover, Oct 21 2024 *)
approved
editing
editing
proposed
a[n_] := n^2 - PrimePi[n^2];
Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Oct 20 2024, after R. J. Mathar *)
approved
editing
editing
proposed
(* Function curlN is defined in A094840 *)
(* Function ThueMorse needs Mma version >= 11 *)
a[n_] := If[n == 1, 1, curlN[Array[ThueMorse, n-1, 0]]];
Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Oct 18 2024 *)
approved
editing