[go: up one dir, main page]

login
Search: a328205 -id:a328205
     Sort: relevance | references | number | modified | created      Format: long | short | data
Numbers k such that both k and k + 1 are Niven numbers in base 2 (A049445).
+10
32
1, 20, 68, 80, 115, 155, 184, 204, 260, 272, 284, 320, 344, 355, 395, 404, 424, 464, 555, 564, 595, 623, 624, 636, 664, 675, 804, 835, 846, 847, 864, 875, 888, 904, 972, 1028, 1040, 1075, 1088, 1124, 1164, 1182, 1211, 1224, 1239, 1266, 1280, 1304, 1315, 1424
OFFSET
1,2
COMMENTS
Cai proved that there are infinitely many runs of 4 consecutive Niven numbers in base 2. Therefore this sequence is infinite.
REFERENCES
József Sándor and Borislav Crstici, Handbook of Number theory II, Kluwer Academic Publishers, 2004, Chapter 4, p. 382.
LINKS
Tianxin Cai, On 2-Niven numbers and 3-Niven numbers, Fibonacci Quarterly, Vol. 34, No. 2 (1996), pp. 118-120.
Wikipedia, Harshad number.
Brad Wilson, Construction of 2n consecutive n-Niven numbers, Fibonacci Quarterly, Vol. 35, No. 2 (1997), pp. 122-128.
EXAMPLE
20 is a term since 20 and 20 + 1 = 21 are both Niven numbers in base 2.
MATHEMATICA
binNivenQ[n_] := Divisible[n, Total @ IntegerDigits[n, 2]]; bnq1 = binNivenQ[1]; seq = {}; Do[bnq2 = binNivenQ[k]; If[bnq1 && bnq2, AppendTo[seq, k - 1]]; bnq1 = bnq2, {k, 2, 10^4}]; seq
PROG
(Magma) f:=func<n|n mod &+Intseq(n, 2) eq 0>; a:=[]; for k in [1..1500] do if forall{m:m in [0..1]|f(k+m)} then Append(~a, k); end if; end for; a; // Marius A. Burtea, Jan 03 2020
(Python)
def sbd(n): return sum(map(int, str(bin(n)[2:])))
def niv2(n): return n%sbd(n) == 0
def aupto(nn): return [k for k in range(1, nn+1) if niv2(k) and niv2(k+1)]
print(aupto(1424)) # Michael S. Branicky, Jan 20 2021
KEYWORD
nonn,base
AUTHOR
Amiram Eldar, Jan 03 2020
STATUS
approved
Numbers k such that both k and k + 1 are Niven numbers.
+10
31
1, 2, 3, 4, 5, 6, 7, 8, 9, 20, 80, 110, 111, 132, 152, 200, 209, 224, 399, 407, 440, 480, 510, 511, 512, 629, 644, 735, 800, 803, 935, 999, 1010, 1011, 1014, 1015, 1016, 1100, 1140, 1160, 1232, 1274, 1304, 1386, 1416, 1455, 1520, 1547, 1651, 1679, 1728, 1853
OFFSET
1,2
COMMENTS
Cooper and Kennedy proved that there are infinitely many runs of 20 consecutive Niven numbers. Therefore this sequence is infinite.
REFERENCES
Jean-Marie De Koninck, Those Fascinating Numbers, American Mathematical Society, 2009, p. 36, entry 110.
LINKS
Curtis Cooper and Robert E. Kennedy, On consecutive Niven numbers, Fibonacci Quarterly, Vol. 21, No. 2 (1993), pp. 146-151.
Helen G. Grundman, Sequences of consecutive Niven numbers, Fibonacci Quarterly, Vol. 32, No. 2 (1994), pp. 174-175.
Wikipedia, Harshad number.
Brad Wilson, Construction of 2n consecutive n-Niven numbers, Fibonacci Quarterly, Vol. 35, No. 2 (1997), pp. 122-128.
EXAMPLE
1 is a term since 1 and 1 + 1 = 2 are both Niven numbers.
MATHEMATICA
nivenQ[n_] := Divisible[n, Total @ IntegerDigits[n]]; nq1 = nivenQ[1]; seq = {}; Do[nq2 = nivenQ[k]; If[nq1 && nq2, AppendTo[seq, k - 1]]; nq1 = nq2, {k, 2, 2000}]; seq
SequencePosition[Table[If[Divisible[n, Total[IntegerDigits[n]]], 1, 0], {n, 2000}], {1, 1}][[;; , 1]] (* Harvey P. Dale, Dec 24 2023 *)
PROG
(Magma) f:=func<n|n mod &+Intseq(n) eq 0>; a:=[]; for k in [1..2000] do if forall{m:m in [0..1]|f(k+m)} then Append(~a, k); end if; end for; a; // Marius A. Burtea, Jan 03 2020
(Python)
from itertools import count, islice
def agen(): # generator of terms
h1, h2 = 1, 2
while True:
if h2 - h1 == 1: yield h1
h1, h2 = h2, next(k for k in count(h2+1) if k%sum(map(int, str(k))) == 0)
print(list(islice(agen(), 52))) # Michael S. Branicky, Mar 17 2024
KEYWORD
nonn,base
AUTHOR
Amiram Eldar, Jan 03 2020
STATUS
approved
Numbers k such that k and k+1 are both primorial base Niven numbers (A333426).
+10
18
1, 8, 24, 32, 44, 64, 65, 132, 212, 224, 244, 245, 296, 368, 424, 425, 468, 560, 656, 720, 728, 737, 869, 1056, 1088, 1416, 1572, 1728, 2100, 2312, 2324, 2344, 2345, 2524, 2525, 2568, 2600, 2672, 2820, 2960, 3032, 3132, 3156, 3200, 3288, 3392, 3444, 4096, 4424
OFFSET
1,2
LINKS
EXAMPLE
1 is a term since 1 and 2 are both primorial base Niven numbers.
MATHEMATICA
max = 6; bases = Prime @ Range[max, 1, -1]; nmax = Times @@ bases - 1; primNivenQ[n_] := Divisible[n, Plus @@ IntegerDigits[n, MixedRadix[bases]]]; q1 = primNivenQ[1]; seq = {}; Do[q2 = primNivenQ[n]; If[q1 && q2, AppendTo[seq, n - 1]]; q1 = q2, {n, 2, nmax}]; seq
KEYWORD
nonn
AUTHOR
Amiram Eldar, Mar 20 2020
STATUS
approved
Numbers k such that k and k+1 are both base phi Niven numbers (A334308).
+10
16
1, 15, 35, 90, 95, 231, 644, 728, 944, 1016, 1110, 1331, 1629, 1736, 1770, 1899, 1925, 2232, 2255, 2384, 2456, 2629, 2652, 2760, 3104, 3176, 3288, 3444, 3729, 3789, 3860, 4410, 4415, 4509, 4544, 4718, 4939, 4960, 5229, 5239, 5489, 5789, 5831, 5984, 6039, 6111
OFFSET
1,2
LINKS
EXAMPLE
1 is a term since 1 and 2 are both base phi Niven numbers.
MATHEMATICA
phiDigSum[1] = 1; phiDigSum[n_] := Plus @@ RealDigits[n, GoldenRatio, 2*Ceiling[ Log[GoldenRatio, n] ]][[1]]; phiNivenQ[n_] := Divisible[n, phiDigSum[n]]; Select[Range[6000], phiNivenQ[#] && phiNivenQ[# + 1] &]
KEYWORD
nonn,base
AUTHOR
Amiram Eldar, Apr 22 2020
STATUS
approved
Numbers k such that k and k + 1 are both Niven numbers in base 3/2 (A342426).
+10
16
1, 168, 459, 1817, 2196, 2197, 2655, 3128, 3280, 3699, 4199, 4575, 4927, 5184, 5795, 6600, 7215, 7259, 7656, 7657, 8448, 9636, 11304, 11339, 12492, 14160, 14175, 14424, 14805, 15624, 15625, 16335, 16336, 16925, 17802, 19170, 20349, 20811, 21624, 21735, 22197
OFFSET
1,2
LINKS
EXAMPLE
168 is a term since both 168 and 169 are Niven numbers in base 3/2. 168 in base 3/2 is 2120220210 and 2+1+2+0+2+2+0+2+1+0 = 12 is a divisor of 168. 169 in base 3/2 is 2120220211 and 2+1+2+0+2+2+0+2+1+1 = 13 is a divisor of 169.
MATHEMATICA
s[0] = 0; s[n_] := s[n] = s[2*Floor[n/3]] + Mod[n, 3]; q[n_] := Divisible[n, s[n]]; Select[Range[22000], q[#] && q[# + 1] &]
CROSSREFS
Subsequence of A342426.
Subsequences: A342428 and A342429.
Similar sequences: A330927 (decimal), A328205 (factorial), A328209 (Zeckendorf), A328213 (lazy Fibonacci), A330931 (binary), A331086 (negaFibonacci), A333427 (primorial), A334309 (base phi), A331820 (negabinary).
KEYWORD
nonn,base
AUTHOR
Amiram Eldar, Mar 11 2021
STATUS
approved
Numbers k such that k and k + 1 are both Gray-code Niven numbers (A344341).
+10
15
1, 2, 3, 6, 7, 8, 14, 15, 27, 30, 31, 32, 39, 44, 51, 56, 62, 63, 75, 99, 104, 111, 123, 126, 127, 128, 135, 144, 155, 159, 174, 175, 184, 185, 195, 204, 207, 215, 224, 231, 234, 235, 243, 244, 248, 254, 255, 264, 275, 284, 294, 300, 304, 305, 315, 335, 354, 375
OFFSET
1,2
LINKS
EXAMPLE
1 is a term since 1 and 2 are both Gray-code Niven numbers.
MATHEMATICA
gcNivenQ[n_] := Divisible[n, DigitCount[BitXor[n, Floor[n/2]], 2, 1]]; Select[Range[400], And @@ gcNivenQ[# + {0, 1}] &]
CROSSREFS
Subsequence of: A344341.
Subsequences: A344343 and A344344.
Similar sequences: A330927 (decimal), A328205 (factorial), A328209 (Zeckendorf), A328213 (lazy Fibonacci), A330931 (binary), A331086 (negaFibonacci), A333427 (primorial), A334309 (base phi), A331820 (negabinary), A342427 (base 3/2).
KEYWORD
nonn,base
AUTHOR
Amiram Eldar, May 15 2021
STATUS
approved
Numbers k such that k and k + 1 are both Lucas-Niven numbers (A351714).
+10
13
1, 2, 3, 6, 7, 10, 11, 29, 39, 47, 57, 80, 123, 129, 134, 152, 159, 170, 176, 199, 206, 245, 279, 326, 384, 387, 398, 404, 521, 531, 543, 560, 579, 615, 644, 651, 684, 755, 843, 849, 854, 872, 879, 890, 896, 944, 1024, 1052, 1064, 1070, 1071, 1095, 1350, 1382
OFFSET
1,2
LINKS
EXAMPLE
6 is a term since 6 and 7 are both Lucas-Niven numbers: the minimal Lucas representation of 6, A130310(6) = 1001, has 2 1's and 6 is divisible by 2, and the minimal Lucas representation of 7, A130310(7) = 10000, has one 1 and 7 is divisible by 1.
MATHEMATICA
lucasNivenQ[n_] := Module[{s = {}, m = n, k = 1}, While[m > 0, If[m == 1, k = 1; AppendTo[s, k]; m = 0, If[m == 2, k = 0; AppendTo[s, k]; m = 0, While[LucasL[k] <= m, k++]; k--; AppendTo[s, k]; m -= LucasL[k]; k = 1]]]; Divisible[n, Plus @@ IntegerDigits[Total[2^s], 2]]]; Select[Range[1400], And @@ lucasNivenQ/@{#, #+1} &]
CROSSREFS
Subsequence of A351714.
A351716 is a subsequence.
KEYWORD
nonn,base
AUTHOR
Amiram Eldar, Feb 17 2022
STATUS
approved
Numbers k such that k and k + 1 are both lazy-Lucas-Niven numbers (A351719).
+10
13
1, 175, 216, 399, 656, 729, 737, 759, 1000, 1991, 2716, 2820, 2925, 3970, 4068, 4224, 4499, 4641, 5316, 5819, 6565, 6720, 6902, 7890, 9840, 10751, 11843, 12194, 12614, 13034, 13272, 14909, 15483, 15495, 16029, 17234, 17444, 17731, 18074, 18885, 19305, 19669, 20188
OFFSET
1,2
LINKS
EXAMPLE
175 is a term since 175 and 176 are both lazy-Lucas-Niven numbers: the maximal Lucas representation of 175, A130311(175) = 1110110101, has 7 1's and 175 is divisible by 5, and the maximal Lucas representation of 176, A130311(7) = 1110110111, has 8 1's and 176 is divisible by 8.
MATHEMATICA
lazy = Select[IntegerDigits[Range[10^6], 2], SequenceCount[#, {0, 0}] == 0 &]; t = Total[#*Reverse@LucasL[Range[0, Length[#] - 1]]] & /@ lazy; s = FromDigits /@ lazy[[TakeWhile[Flatten[FirstPosition[t, #] & /@ Range[Max[t]]], NumberQ]]]; SequencePosition[Divisible[Range[Length[s]], Plus @@@ IntegerDigits[s]], {True, True}][[;; , 1]]
CROSSREFS
Subsequence of A351719.
A351721 is a subsequence.
KEYWORD
nonn,base
AUTHOR
Amiram Eldar, Feb 17 2022
STATUS
approved
Numbers k such that k and k+1 are both tribonacci-Niven numbers (A352089).
+10
13
1, 6, 7, 12, 13, 20, 26, 27, 39, 68, 75, 80, 81, 87, 115, 128, 135, 149, 176, 184, 185, 195, 204, 215, 224, 230, 236, 243, 264, 278, 284, 291, 344, 364, 399, 447, 506, 507, 519, 548, 555, 560, 575, 595, 615, 635, 656, 664, 665, 684, 704, 725, 744, 777, 804, 824
OFFSET
1,2
COMMENTS
Numbers k such that A278043(k) | k and A278043(k+1) | k+1.
The odd tribonacci numbers, A000073(A042964(m)), are all terms.
LINKS
EXAMPLE
6 is a term since 6 and 7 are both tribonacci-Niven numbers: the minimal tribonacci representation of 6, A278038(6) = 110, has 2 1's and 6 is divisible by 2, and the minimal tribonacci representation of 7, A278038(7) = 1000, has one 1 and 7 is divisible by 1.
MATHEMATICA
t[1] = 1; t[2] = 2; t[3] = 4; t[n_] := t[n] = t[n - 1] + t[n - 2] + t[n - 3]; q[n_] := Module[{s = {}, m = n, k}, While[m > 0, k = 1; While[t[k] <= m, k++]; k--; AppendTo[s, k]; m -= t[k]; k = 1]; Divisible[n, DigitCount[Total[2^(s - 1)], 2, 1]]]; Select[Range[1000], q[#] && q[# + 1] &]
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Amiram Eldar, Mar 04 2022
STATUS
approved
Numbers k such that k and k+1 are both lazy-tribonacci-Niven numbers (A352107).
+10
11
1, 20, 39, 75, 115, 135, 155, 175, 176, 184, 204, 215, 264, 567, 684, 704, 725, 791, 846, 872, 1089, 1104, 1115, 1134, 1183, 1184, 1211, 1224, 1407, 1575, 1840, 1880, 2064, 2075, 2151, 2191, 2232, 2259, 2260, 2415, 2529, 2583, 2624, 2780, 2820, 2848, 2888, 2988
OFFSET
1,2
LINKS
EXAMPLE
20 is a term since 20 and 21 are both lazy-tribonacci-Niven numbers: the maximal tribonacci representation of 20, A352103(20) = 10111, has 4 1's and 20 is divisible by 4, and the maximal tribonacci representation of 21, A352103(20) = 11001, has 3 1's and 21 is divisible by 3.
MATHEMATICA
t[1] = 1; t[2] = 2; t[3] = 4; t[n_] := t[n] = t[n - 1] + t[n - 2] + t[n - 3]; trib[n_] := Module[{s = {}, m = n, k}, While[m > 0, k = 1; While[t[k] <= m, k++]; k--; AppendTo[s, k]; m -= t[k]; k = 1]; IntegerDigits[Total[2^(s - 1)], 2]]; q[n_] := Module[{v = trib[n]}, nv = Length[v]; i = 1; While[i <= nv - 3, If[v[[i ;; i + 3]] == {1, 0, 0, 0}, v[[i ;; i + 3]] = {0, 1, 1, 1}; If[i > 3, i -= 4]]; i++]; i = Position[v, _?(# > 0 &)]; If[i == {}, False, Divisible[n, Total[v[[i[[1, 1]] ;; -1]]]]]]; Select[Range[3000], q[#] && q[# + 1] &]
CROSSREFS
Subsequence of A352107.
Subsequences: A352109, A352110.
KEYWORD
nonn,base
AUTHOR
Amiram Eldar, Mar 05 2022
STATUS
approved

Search completed in 0.090 seconds