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.

Showing 1-3 of 3 results.

A384443 a(n) is the product of the prime digits of n; or 1 if n contains no prime digits.

Original entry on oeis.org

1, 2, 3, 1, 5, 1, 7, 1, 1, 1, 1, 2, 3, 1, 5, 1, 7, 1, 1, 2, 2, 4, 6, 2, 10, 2, 14, 2, 2, 3, 3, 6, 9, 3, 15, 3, 21, 3, 3, 1, 1, 2, 3, 1, 5, 1, 7, 1, 1, 5, 5, 10, 15, 5, 25, 5, 35, 5, 5, 1, 1, 2, 3, 1, 5, 1, 7, 1, 1, 7, 7, 14, 21, 7, 35, 7, 49, 7, 7, 1, 1, 2, 3, 1
Offset: 1

Views

Author

Felix Huber, Jun 03 2025

Keywords

Examples

			a(2025) = 2*2*5 = 20.
		

Crossrefs

Programs

  • Maple
    A384443:=n->mul(select(isprime,convert(n,'base',10)));seq(A384443(n),n=1..84);
  • Mathematica
    a[n_]:=If[ContainsAny[IntegerDigits[n],{2,3,5,7}],Times@@Select[IntegerDigits[n],PrimeQ],1];Array[a,100] (* James C. McMahon, Jun 20 2025 *)
  • PARI
    a(n) = vecprod(select(isprime, digits(n))); \\ Michel Marcus, Jun 04 2025

A384445 a(n) is the number of multisets of n decimal digits where the sum of the digits equals the product of the prime digits.

Original entry on oeis.org

5, 6, 7, 10, 23, 43, 74, 125, 199, 305, 449, 637, 885, 1216, 1649, 2184, 2852, 3664, 4657, 5863, 7298, 9002, 10993, 13312, 16000, 19084, 22613, 26606, 31120, 36192, 41867, 48220, 55317, 63232, 72022, 81746, 92479, 104282, 117229, 131393, 146843, 163652, 181892
Offset: 1

Views

Author

Felix Huber, Jun 03 2025

Keywords

Examples

			a(3) = 7 because exactly for the 7 multisets with 3 digits {0, 0, 1}, {0, 0, 2}, {0, 0, 3}, {0, 0, 5}, {0, 0, 7}, {0, 2, 2} and {1, 2, 3} their sum equals the product of the prime digits.
a(4) = 10 because exactly for the 10 multisets with 4 digits {0, 0, 0, 1}, {0, 1, 2, 3}, {1, 2, 4, 7}, {1, 3, 5, 6}, {0, 0, 0, 2}, {0, 0, 2, 2}, {0, 0, 0, 3}, {0, 0, 0, 5}, {5, 5, 6, 9} and {0, 0, 0, 7} their sum equals the product of the prime digits.
		

Crossrefs

Programs

  • Maple
    f:=proc(p,n)
        local c,d,i,l,m,r,s,t,u,w,x,y,z;
        m:={0,1,4,6,8,9};
        t:=seq(cat(x,i),i in m);
        y:={l='Union'(t),w='Set'(l),t=~'Atom'};
        d:=(map2(apply,s,{t})=~m) union {s(w)='Set'(s(l))};
        Order:=p+1;
        r:=combstruct:-agfseries(y,d,'unlabeled',z,[[u,s]])[w(z,u)];
        r:=collect(convert(r,'polynom'),[z,u],'recursive');
        c:=coeff(r,z,p);
        coeff(c,u,n)
    end proc:
    A384445:=proc(n)
        local a,k,m,s,p,j,L;
        a:=1;
            for k from 9*n to 1 by -1 do
                L:=ifactors(k)[2];
                m:=nops(L);
                if m>0 and L[m,1]<=7 then
                    p:=n-add(L[j,2],j=1..m);
                    s:=k-add(L[j,1]*L[j,2],j=1..m);
                    if s=0 and p>=0 then
                        a:=a+1
                    elif p>0 and s>0 then
                        a:=a+f(p,s)
                    fi
                fi
    	od;
    	return a
    end proc;
    seq(A384445(n),n=1..43);

A384505 a(n) is the number of multisets of n positive decimal digits where the sum of the digits equals the product of the prime digits.

Original entry on oeis.org

5, 1, 1, 3, 13, 20, 31, 51, 74, 106, 144, 188, 248, 331, 433, 535, 668, 812, 993, 1206, 1435, 1704, 1991, 2319, 2688, 3084, 3529, 3993, 4514, 5072, 5675, 6353, 7097, 7915, 8790, 9724, 10733, 11803, 12947, 14164, 15450, 16809, 18240, 19757, 21374, 23073, 24876, 26759
Offset: 1

Views

Author

Felix Huber, Jun 11 2025

Keywords

Examples

			a(1) = 5 because exactly for the 5 multisets with 1 digits {1}, {2}, {3}, {5}, and {7} their sum equals the product of the prime digits.
a(2) = 1 because only for 1 multiset with 2 positive digits {2, 2} their sum equals the product of the prime digits: 2 + 2 = 2*2 = 4.
a(3) = 1 because only for 1 multiset with 3 positive digits {1, 2, 3} their sum equals the product of the prime digits: 1 + 2 + 3 = 2*3 = 6.
a(4) = 3 because exactly for the 3 multisets with 4 digits {1, 2, 4, 7}, {1, 3, 5, 6}, and {5, 5, 6, 9} their sum equals the product of the prime digits: 1 + 2 + 4 + 7 = 2 * 7 = 14, 1 + 3 + 5 + 6 = 3*5 = 15, 5 + 5 + 6 + 9 = 5*5 = 25.
		

Crossrefs

Programs

  • Maple
    f:=proc(p,n)
        local i,l,m,s,t,u,w,x,z;
        m:={1,4,6,8,9};
        t:=seq(cat(x,i),i in m);
        Order:=p+1;
        coeff(coeff(collect(convert(combstruct:-agfseries({l='Union'(t),w='Set'(l),t=~'Atom'},(map2(apply,s,{t})=~m) union {s(w)='Set'(s(l))},'unlabeled',z,[[u,s]])[w(z,u)],'polynom'),[z,u],'recursive'),z,p),u,n)
    end proc:
    A384505:=proc(n)
        local a,k,m,s,p,j,L;
        if n=1 then
            5
        elif n=2 then
            1
        else
            a:=0;
            for k from 9*n to 1 by -1 do
                L:=ifactors(k)[2];
                m:=nops(L);
                if m>0 and L[m,1]<=7 then
                    p:=n-add(L[j,2],j=1..m);
                    s:=k-add(L[j,1]*L[j,2],j=1..m);
                    if p>0 and s>0 then
                        a:=a+f(p,s)
                    fi
                fi
    	od;
    	return a
    	fi;
    end proc;
    seq(A384505(n),n=1..48);

Formula

a(n) = A384445(n) - A384445(n-1) for n > 1.
Showing 1-3 of 3 results.