login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 56th year, we are closing in on 350,000 sequences, and we’ve crossed 9,700 citations (which often say “discovered thanks to the OEIS”).

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A254605 The minimum absolute difference between k*m1 and m2 (m1<m2), where m1*m2 is the n-th term of A075362. 2
0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 2, 1, 0, 0, 1, 1, 1, 2, 1, 0, 0, 0, 1, 0, 2, 2, 1, 0, 0, 1, 0, 1, 1, 3, 2, 1, 0, 0, 0, 1, 2, 0, 2, 3, 2, 1, 0, 0, 1, 1, 1, 1, 1, 3, 3, 2, 1, 0, 0, 0, 0, 0, 2, 0, 2, 4, 3, 2, 1, 0, 0, 1, 1, 1, 2, 1, 1, 3, 4 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,19

COMMENTS

k is an integer that minimizes |k*m1-m2|. It is trivial that if j is the integer part of m2/m1, k is either j or j+1.

Interestingly, suppose b is the smallest n such that a(n)=c; the sequence s(c)=b is then sequence A022267.

LINKS

Lei Zhou, Table of n, a(n) for n = 1..10000

EXAMPLE

A075362(1)=1=1*1, 1-1=0, so a(1)=0;

A075362(5)=6=2*3, 3-2=1, 2*2-3=1, so a(5)=1;

A075362(19)=24=4*6, 6-4=2, 4*2-6=2, so a(19)=2.

MATHEMATICA

NumDiff[n1_, n2_] :=  Module[{c1 = n1, c2 = n2}, If[c1 < c2, c1 = c1 + c2; c2 = c1 - c2; c1 = c1 - c2];

  k = Floor[c1/c2]; a1 = c1 - k*c2; If[a1 == 0, a2 = 0, a2 = (k + 1) c2 - c1]; Return[Min[a1, a2]]];

p1 = 1; p2 = 0; Table[p2++; If[p2 > p1, p1 = p2; p2 = 1];  NumDiff[p1, p2], {n, 1, 100}]

CROSSREFS

Cf. A075362, A022267.

Sequence in context: A204770 A333382 A143379 * A335664 A269518 A219840

Adjacent sequences:  A254602 A254603 A254604 * A254606 A254607 A254608

KEYWORD

nonn,easy

AUTHOR

Lei Zhou, Feb 02 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
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified December 7 20:40 EST 2021. Contains 349589 sequences. (Running on oeis4.)