cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A333666 Smallest k > 0 with gcd(k, rev(k)) = n, where rev(k) is digit reversal of k and with sum of digits of k = n, or 0 if no such k exists.

This page as a plain text file.
%I A333666 #76 Oct 07 2021 13:50:33
%S A333666 1,2,3,4,5,6,7,8,9,0,209,48,4000009,21182,5055,21184,13328,288,12844,
%T A333666 0,1596,2398,13892,2976,52675,45890,2889,61768,178292,0,177475,29984,
%U A333666 42999,279718,529865,29988,1009009009009,485678,1951599,0,694499,655998,1677688,658988
%N A333666 Smallest k > 0 with gcd(k, rev(k)) = n, where rev(k) is digit reversal of k and with sum of digits of k = n, or 0 if no such k exists.
%C A333666 This differs from A069554 in that, additionally, the sum of the digits of a(n) must be equal to n. This is not required in A069554.
%C A333666 As gcd(k, rev(k)) = n, n | k and n | rev(k). - _David A. Corneth_, Sep 03 2020
%C A333666 Since the sum of the digits of k is n and n | k, all the terms that are not 0 are Niven numbers (A005349). - _Amiram Eldar_, Sep 03 2020
%C A333666 The first digit of any number of this sequence is less than or equal to the last digit of this number (provided that the last digit is nonzero), because if k satisfies all requirements, also rev(k) does. This means that numbers starting with a "9" are quite rare. So far we have found only 9. But numbers ending with a "1" seem to be even less frequent. Amongst the first 303 terms of this sequence there is none except the trivial solution a(1) = 1. The second term of this sequence ending with a "1", if it exists, is still to be found. - _Ruediger Jehn_, Sep 20 2020 [Corrected by _Pontus von Brömssen_, Oct 07 2021]
%H A333666 Ruediger Jehn, <a href="/A333666/b333666.txt">Table of n, a(n) for n = 1..303</a>
%H A333666 Ruediger Jehn, <a href="/A333666/a333666_2.pdf">Proofs for difficult terms</a>
%H A333666 Rüdiger Jehn, <a href="https://arxiv.org/abs/2104.02482">Porous Numbers</a>, arXiv:2104.02482 [math.GM], 2021.
%F A333666 a(10*n) = 0 since all multiples of 10 have a 0 at the end, but their reverse numbers have no 0 at the end and therefore 10*n cannot be their gcd.
%e A333666 a(11) = 209. The sum of the digits is 11 and gcd(209,902) = 11.
%e A333666 a(12) = 48. The sum of the digits is 12 and gcd(48,84) = 12.
%t A333666 m = 36; s = Table[0, {m}]; c = 0; n = 1; While[c < m - Quotient[m, 10], g = GCD[n, FromDigits @ Reverse @ (d = IntegerDigits[n])]; If[g <= m && g == Plus @@ d && s[[g]] == 0, c++; s[[g]] = n]; n++]; s (* _Amiram Eldar_, Sep 03 2020 *)
%o A333666 (Python)
%o A333666 for n in range(11, 20):
%o A333666     for k in range(n, 1000000000, n):
%o A333666        s = str(k)
%o A333666        revk = "" # digit reversal of k
%o A333666        sum = 0
%o A333666        for i in range(len(s)):
%o A333666           revk = revk + s[len(s) - i - 1]
%o A333666           sum = sum + int(s[i])
%o A333666        g = gcd(k,int(revk))
%o A333666        if g == n and sum == n:
%o A333666           print(n, k, revk, g)
%o A333666           break
%o A333666 (PARI) a(n) = {if ((n % 10) == 0, return(0)); my(k=n); while (! ((sumdigits(k)==n) && (gcd(k, fromdigits(Vecrev(digits(k)))) == n)), k+=n); k;} \\ _Michel Marcus_, Sep 03 2020
%Y A333666 Cf. A004086, A005349, A007953, A069554.
%K A333666 nonn,base
%O A333666 1,2
%A A333666 _Ruediger Jehn_ and _Kester Habermann_, Sep 03 2020