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-5 of 5 results.

A368062 Numbers k such that k = A257850(k) + A257297(k).

Original entry on oeis.org

0, 36, 655, 1258, 6208, 12508, 45715, 65455, 75385, 125008, 235297, 1250008, 2857144, 3214288, 4210528, 6545455, 6792453, 12500008, 34615386, 47058824, 87671233, 125000008, 654545455, 1250000008, 9529411765, 12500000008, 39130434783, 45714285715, 65454545455, 75384615385
Offset: 1

Views

Author

Nicolas Bělohoubek, Dec 10 2023

Keywords

Examples

			     0 = 0*0   +   0*0;
    36 = 3*6   +   3*6;
   655 = 6*55  +  65*5;
  6208 = 6*208 + 620*8;
  ...
		

Crossrefs

Programs

  • Mathematica
    Select[Range[0,10^6], Part[digits=IntegerDigits[#],1]FromDigits[Drop[digits,1]] + FromDigits[Drop[digits,-1]]Part[digits,Length[digits]] == # &] (* Stefano Spezia, Dec 10 2023 *)
  • PARI
    \\ See links.
  • Python
    def ok(n):
        if n < 10: return n == 0
        s = str(n)
        return n == int(s[0])*int(s[1:]) + (n%10)*(n//10)
    print([k for k in range(10**6) if ok(k)]) # Michael S. Branicky, Dec 10 2023
    
  • Python
    # faster for generating initial segment of sequence
    from itertools import count, islice
    def agen(): # generator of terms
        yield 0
        for digits in count(2):
            for first in range(1, 10):
                base = first*10**(digits-1)
                for rest in range(10**(digits-1)):
                    n = base + rest
                    if first*rest + (n%10)*(n//10) == n:
                        yield n
                print("...", digits, first, time()-time0, alst)
    print(list(islice(agen(), 18))) # Michael S. Branicky, Dec 10 2023
    

Extensions

a(24)-a(30) from Michael S. Branicky, Dec 10 2023

A035930 Maximal product of any two numbers whose concatenation is n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 0, 3, 6, 9, 12, 15, 18, 21, 24, 27, 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 0, 6, 12, 18, 24, 30, 36, 42, 48, 54, 0, 7, 14, 21, 28, 35, 42, 49, 56, 63, 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 0, 9, 18, 27, 36, 45, 54, 63, 72, 81, 0, 10, 20, 30, 40, 50, 60, 70
Offset: 0

Views

Author

Keywords

Comments

Agrees up to a(100) = 0 with A088117, A171765 and A257297, but all of the four differ in a(101) and subsequent values. - M. F. Hasler, Sep 01 2021

Examples

			a(341) = max(34*1,3*41) = 123.
		

Crossrefs

Different from A007954, A088117, A171765 and A257297. Cf. A035931-A035935.

Programs

  • Haskell
    a035930 n | n < 10    = 0
              | otherwise = maximum $ zipWith (*)
                (map read $ init $ tail $ inits $ show n)
                (map read $ tail $ init $ tails $ show n)
    -- Reinhard Zumkeller, Aug 14 2011
    
  • Maple
    a:= proc(n) local l, m; l:= convert(n, base, 10); m:= nops(l);
          `if`(m<2, 0, max(seq(parse(cat(seq(l[m-i], i=0..j-1)))
           *parse(cat(seq(l[m-i], i=j..m-1))), j=1..m)))
        end:
    seq(a(n), n=0..120);  # Alois P. Heinz, May 22 2009
  • Mathematica
    Flatten[With[{c=Range[0,9]},Table[c*n,{n,0,10}]]] (* Harvey P. Dale, Jun 07 2012 *)
  • PARI
    apply( {A035930(n)=if(n>9,vecmax([vecprod(divrem( n,10^j))|j<-[1..logint(n,10)]]))}, [0..111]) \\ M. F. Hasler, Sep 01 2021
    
  • Python
    def a(n):
        s = str(n)
        return max((int(s[:i])*int(s[i:]) for i in range(1, len(s))), default=0)
    print([a(n) for n in range(108)]) # Michael S. Branicky, Sep 01 2021

Extensions

An erroneous formula was deleted by N. J. A. Sloane, Dec 23 2008

A257850 a(n) = floor(n/10) * (n mod 10).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 0, 3, 6, 9, 12, 15, 18, 21, 24, 27, 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 0, 6, 12, 18, 24, 30, 36, 42, 48, 54, 0, 7, 14, 21, 28, 35, 42, 49, 56, 63, 0, 8
Offset: 0

Views

Author

M. F. Hasler, May 10 2015

Keywords

Comments

Equivalently, write n in base 10, multiply the last digit by the number with its last digit removed.
See A142150(n-1) for the base 2 analog and A257843 - A257849 for the base 3 - base 9 variants.
The first 100 terms coincide with those of A035930 (maximal product of any two numbers whose concatenation is n), A171765 (product of digits of n, or 0 for n<10), A257297 ((initial digit of n)*(n with initial digit removed)), but the sequence is of course different from each of these three.
The terms a(10) - a(100) also coincide with those of A007954 (product of decimal digits of n).

Crossrefs

Cf. A142150 (the base 2 analog), A115273, A257844 - A257849.

Programs

  • Magma
    [Floor(n/10)*(n mod 10): n in [0..100]]; // Vincenzo Librandi, May 11 2015
    
  • Mathematica
    Table[Floor[n/10] Mod[n, 10], {n, 100}] (* Vincenzo Librandi, May 11 2015 *)
  • PARI
    a(n,b=10)=(n=divrem(n,b))[1]*n[2]
    
  • Python
    def A257850(n): return n//10*(n%10) # M. F. Hasler, Sep 01 2021

Formula

a(n) = 2*a(n-10)-a(n-20). - Colin Barker, May 11 2015
G.f.: x^11*(9*x^8+8*x^7+7*x^6+6*x^5+5*x^4+4*x^3+3*x^2+2*x+1) / ((x-1)^2*(x+1)^2*(x^4-x^3+x^2-x+1)^2*(x^4+x^3+x^2+x+1)^2). - Colin Barker, May 11 2015

A330633 The concatenation of the products of every pair of consecutive digits of n (with a(n) = 0 for 0 <= n <= 9).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 0, 3, 6, 9, 12, 15, 18, 21, 24, 27, 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 0, 6, 12, 18, 24, 30, 36, 42, 48, 54, 0, 7, 14, 21, 28, 35, 42, 49, 56, 63, 0
Offset: 0

Views

Author

Scott R. Shannon, Dec 21 2019

Keywords

Comments

If the decimal expansion of n is d_1 d_2 ... d_k then a(n) is the number formed by concatenating the decimal numbers d_1*d_2, d_2*d_3, ..., d_{k-1}*d_k.
Due to the fact that for two digit numbers the sequence is simply the multiplication of those two numbers, this sequence matches numerous others for the first 100 terms. See the sequences in the cross references. The terms begin to differ beyond n = 100.

Crossrefs

Programs

  • Maple
    read("transforms") :
    A330633 := proc(n)
        local dgs,L,i ;
        if n <=9 then
            0;
        else
            dgs := ListTools[Reverse](convert(n,base,10)) ;
            L := [] ;
            for i from 2 to nops(dgs) do
                L := [op(L), op(i-1,dgs)*op(i,dgs)] ;
            end do:
            digcatL(L) ;
        end if;
    end proc: # R. J. Mathar, Jan 11 2020
  • Mathematica
    Array[If[Or[# == 0, IntegerLength@ # == 1], 0, FromDigits[Join @@ IntegerDigits[Times @@ # & /@ Partition[IntegerDigits@ #, 2, 1]]]] &, 81, 0] (* Michael De Vlieger, Dec 23 2019 *)
  • PARI
    a(n) = my(d=digits(n), s="0"); for (k=1, #d-1, s=concat(s, d[k]*d[k+1])); eval(s); \\ Michel Marcus, Apr 28 2020

Formula

a(10) = 0 as 1 * 0 = 0.
a(29) = 18 as 2 * 9 = 18.
a(100) = 0 as 1 * 0 = 0 and 0 = 0 = 0, and '00' is reduced to 0.
a(110) = 10 as 1 * 1 = 1 and 1 * 0 = 0. This is the first term that differs from A007954 and A171765, the multiplication of all digits of n.

A347470 Least product of any two numbers whose concatenation is n, excluding 0*n for n > 9.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 0, 3, 6, 9, 12, 15, 18, 21, 24, 27, 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 0, 6, 12, 18, 24, 30, 36, 42, 48, 54, 0, 7, 14, 21, 28, 35, 42, 49, 56, 63, 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 0, 9, 18, 27, 36, 45, 54, 63, 72, 81, 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 0, 11, 12
Offset: 0

Views

Author

M. F. Hasler, Sep 03 2021

Keywords

Comments

Leading zeros are not allowed: e.g., 101 = concat(10,1) but not concat(1,01). Although 0 is a valid number, we don't allow the trivial decomposition n = concat(0, n) except for the single-digit n < 10, otherwise the minimal product would always be 0.
For n < 111, this sequence coincides with A035930 (same with "largest"), because there is only one possible concatenation, but it differs for n > 111, cf. examples.

Examples

			The number n = 112 is the concatenation of 1 and 12, or of 11 and 2, with respective products 1*12 = 12 and 11*2 = 22. Hence, a(112) = 12, while A035930(112) = 22.
		

Crossrefs

Programs

  • PARI
    apply( {A347470(x,t(b,c)=if(c\10<=b%c,b\c*(b%c),c>10,oo))= if(x>9,vecmin(vector(logint(x,10),j,t(x,10^j))))}, [0..112])
Showing 1-5 of 5 results.