A364123 Stolarsky-Niven numbers: numbers that are divisible by the number of 1's in their Stolarsky representation (A364121).
2, 4, 6, 8, 9, 12, 14, 16, 20, 22, 24, 27, 30, 36, 38, 40, 42, 44, 48, 54, 56, 57, 60, 65, 69, 72, 75, 80, 84, 85, 90, 92, 96, 98, 100, 102, 104, 108, 112, 116, 120, 124, 126, 132, 136, 138, 145, 147, 150, 153, 155, 159, 160, 175, 180, 185, 190, 195, 196, 205
Offset: 1
Examples
4 is a term since its Stolarsky representation, A364121(4) = 10, has one 1 and 4 is divisible by 1. 6 is a term since its Stolarsky representation, A364121(6) = 101, has 2 1's and 6 is divisible by 2.
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000
Crossrefs
Programs
-
Mathematica
stol[n_] := stol[n] = If[n == 1, {}, If[n != Round[Round[n/GoldenRatio]*GoldenRatio], Join[stol[Floor[n/GoldenRatio^2] + 1], {0}], Join[stol[Round[n/GoldenRatio]], {1}]]]; stolNivQ[n_] := n > 1 && Divisible[n, Total[stol[n]]]; Select[Range[200], stolNivQ]
-
PARI
stol(n) = {my(phi=quadgen(5)); if(n==1, [], if(n != round(round(n/phi)*phi), concat(stol(floor(n/phi^2) + 1), [0]), concat(stol(round(n/phi)), [1])));} isA364123(n) = n > 1 && !(n % vecsum(stol(n)));
Comments