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.

A064702 Nonnegative numbers such that additive and multiplicative digital roots coincide.

This page as a plain text file.
%I A064702 #41 Feb 16 2025 08:32:45
%S A064702 0,1,2,3,4,5,6,7,8,9,22,123,132,137,139,168,173,179,186,188,193,197,
%T A064702 213,231,233,267,276,299,312,317,319,321,323,332,346,364,371,389,391,
%U A064702 398,436,463,618,627,634,643,672,681,713,719,726,731,762,791,816,818,839
%N A064702 Nonnegative numbers such that additive and multiplicative digital roots coincide.
%C A064702 If k is in this sequence then all permutations of (the digits of) k are in this sequence.
%C A064702 A010888(a(n)) = A031347(a(n)). - _Reinhard Zumkeller_, Jul 10 2013
%H A064702 Nathaniel Johnston, <a href="/A064702/b064702.txt">Table of n, a(n) for n = 1..10000</a>
%H A064702 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/DigitalRoot.html">Digital Root</a>
%H A064702 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/MultiplicativeDigitalRoot.html">Multiplicative Digital Root</a>
%H A064702 Wikipedia, <a href="http://en.wikipedia.org/wiki/Digital_root">Digital root</a>
%H A064702 Wikipedia, <a href="http://en.wikipedia.org/wiki/Multiplicative_digital_root">Multiplicative digital root</a>
%H A064702 <a href="/index/Ar#10-automatic">Index entries for 10-automatic sequences</a>.
%p A064702 A007954 := proc(n) return mul(d, d=convert(n,base,10)): end: A031347 := proc(n) local m: m:=n: while(length(m)>1)do m:=A007954(m): od: return m: end: A064702 := proc(n) option remember: local k: if(n=1)then return 1:fi: for k from procname(n-1)+1 do if(A031347(k)-1 = (k-1) mod 9)then return k: fi: od: end: seq(A064702(n),n=1..56); # _Nathaniel Johnston_, May 04 2011
%t A064702 okQ[n_]:=NestWhile[Times@@IntegerDigits[#]&,n,#>9&]== NestWhile[ Total[ IntegerDigits[ #]]&, n,#>9&]; Select[Range[1000],okQ]  (* _Harvey P. Dale_, Apr 20 2011 *)
%o A064702 (Haskell)
%o A064702 a064702 n = a064702_list !! (n-1)
%o A064702 a064702_list = filter (\x -> a010888 x == a031347 x) [1..]
%o A064702 -- _Reinhard Zumkeller_, Jul 10 2013
%o A064702 (PARI) is(n) = my(cn = n); while(cn > 9, d = digits(cn); cn = prod(i = 1, #d, d[i])); cn - 1 == (n-1)%9 \\ _David A. Corneth_, Aug 23 2018
%o A064702 (Python)
%o A064702 from math import prod
%o A064702 def A010888(n):
%o A064702     while n > 9: n = sum(map(int, str(n)))
%o A064702     return n
%o A064702 def A031347(n):
%o A064702     while n > 9: n = prod(map(int, str(n)))
%o A064702     return n
%o A064702 def ok(n): return A010888(n) == A031347(n)
%o A064702 print([k for k in range(840) if ok(k)]) # _Michael S. Branicky_, Sep 17 2022
%Y A064702 Cf. A010888, A031347, A239427.
%K A064702 easy,nice,nonn,base
%O A064702 1,3
%A A064702 _Santi Spadaro_, Oct 12 2001
%E A064702 Definition rephrased by _Reinhard Zumkeller_, Jul 10 2013
%E A064702 Initial 0 added by _Halfdan Skjerning_, Aug 21 2018