login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A190820 In base 2 lunar arithmetic, number of distinct squares of length 2n+1. 3
2, 2, 4, 8, 15, 29, 55, 105, 197, 367, 678, 1261, 2326, 4293, 7902, 14431, 26363, 47899 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,1

LINKS

Table of n, a(n) for n=0..17.

D. Applegate, M. LeBrun and N. J. A. Sloane, Dismal Arithmetic, arXiv:1107.1130 [math.NT], 2011. [Note: we have now changed the name from "dismal arithmetic" to "lunar arithmetic" - the old name was too depressing]

Index entries for sequences related to dismal (or lunar) arithmetic

FORMULA

a(n)= #{k in A067398: A070939(k)=2*n+1}. - R. J. Mathar, Nov 23 2015

MAPLE

rebase := proc(L)

    add( op(i, L)*2^(i-1), i=1..nops(L)) ;

end proc:

dismadd := proc(a, b)

    local adgs, bdgs, alen, blen, L, i ;

    adgs := convert(a, base, 2) ;

    bdgs := convert(b, base, 2) ;

    alen := nops(adgs) ;

    blen := nops(bdgs) ;

    L := [] ;

    for i from 1 to max(alen, blen) do

        if i <= alen and i <= blen then

            L := [op(L), max(op(i, adgs), op(i, bdgs))] ;

        elif i <= alen then

            L := [op(L), op(i, adgs)] ;

        else

            L := [op(L), op(i, bdgs)] ;

        end if;

    end do:

    rebase(L) ;

end proc:

dismult := proc(a, b)

    local bdgs, blen, c, i ;

    if b = 0 then

        return 0;

    end if;

    bdgs := convert(b, base, 2) ;

    blen := nops(bdgs) ;

    if blen = 1 then

        # cannot be 0 (already above), so b=1

        return a;

    else

        c := 0 ;

        for i from 1 to blen do

            if op(i, bdgs) <> 0 then

                c := dismadd(c, 2^(i-1)*a ) ;

            end if;

        end do:

    end if;

    c ;

end proc:

A190820 := proc(n)

    local c, sq;

    sq := {} ;

    # length of square is 2*n+1 = 2*len(i)-1, so len(i)=n+1.

    for c from 2^n to 2^(n+1)-1 do

        sq := sq union { dismult(c, c) } ;

    end do:

    nops(sq) ;

end proc:

CROSSREFS

Cf. A067398, A191342.

Sequence in context: A000018 A075126 A098788 * A153999 A154002 A154005

Adjacent sequences:  A190817 A190818 A190819 * A190821 A190822 A190823

KEYWORD

nonn,base,more

AUTHOR

N. J. A. Sloane, Jun 01 2011

EXTENSIONS

a(16) and a(17) from R. J. Mathar, Nov 23 2015

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified April 24 18:50 EDT 2017. Contains 285346 sequences.