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.
%I A305257 #21 Feb 16 2025 08:33:54 %S A305257 1,2,3,4,5,6,7,8,9,22,123,132,213,231,312,321,1124,1142,1214,1241, %T A305257 1412,1421,2114,2141,2411,4112,4121,4211,11133,11222,11313,11331, %U A305257 12122,12212,12221,13113,13131,13311,21122,21212,21221,22112,22121,22211,31113,31131,31311,33111 %N A305257 If pd(x) is the product of the digits of the number x and sd(x) the sum of the digits of the number x then the sequence lists all the positive numbers n for which pd(n) = sd(n) and sd(pd(n)) = pd(sd(n)). %C A305257 Sequence is finite with 48 terms. %C A305257 Also numbers n such that pd(n) = sd(n) and simultaneously both the additive and multiplicative persistences of n are 0 or 1. %C A305257 Subsequence of A128290. Intersection of A128290 and A034710. %C A305257 Numbers k such that A007953(k) = A010888(k) = A007954(k) = A031347(k). - _Mohammed Yaseen_, Nov 12 2022 %H A305257 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/AdditivePersistence.html">Additive Persistence.</a> %H A305257 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/MultiplicativePersistence.html">Multiplicative Persistence.</a> %e A305257 321 -> sd(321) = 3+2+1 = 6; pd(321) = 3*2*1 = 6; pd(sd(321)) = pd(6) = 6; sd(pd(321)) = sd(6) = 6. %t A305257 sod[n_] := Plus@@ IntegerDigits@ n; pod[n_] := Times@@ IntegerDigits@ n; Select[ Range[10^5], pod@ # == sod@ # && pod@ sod@ # == sod@ pod@ # &] (* _Giovanni Resta_, May 30 2018 *) %o A305257 MAGMA [n: n in [1..1000000] | &+Intseq(n) eq &*Intseq(n) and &*Intseq(&+Intseq(n)) eq &+Intseq(&*Intseq(n))] %o A305257 (PARI) pd(n) = my(d=digits(n)); factorback(d); %o A305257 alias(sd, sumdigits); %o A305257 isok(n) = my(p=pd(n), s=sd(n)); (p==s) && (sd(p) == pd(s)); \\ _Michel Marcus_, May 30 2018 %o A305257 (Python) %o A305257 from math import prod %o A305257 def pd(x): return prod(map(int, str(x))) %o A305257 def sd(x): return sum(map(int, str(x))) %o A305257 def ok(n): return pd(n) == sd(n) and sd(pd(n)) == pd(sd(n)) %o A305257 print([k for k in range(1, 10**5) if ok(k)]) # _Michael S. Branicky_, Nov 12 2022 %Y A305257 Cf. A007953, A007954, A010888, A031347, A034710, A128290. %K A305257 nonn,base,fini,full %O A305257 1,2 %A A305257 _Jaroslav Krizek_, May 28 2018